Score:0

Why is console output not stored in my log file?

lr flag

I tried to run this command:

$ python flathunt.py >> job.log
[2022/01/16 20:33:49|config.py         |INFO    ]: Using config /home/adam/flathunter/config.yaml

according to my understanding from How do I save terminal output to a file? the output [2022/01/16 20:33:49|config.py |INFO ]: Using config /home/adam/flathunter/config.yaml that was caused by flathunt.py script should have not been printed on the screen but stored in the job.log file. However, the opposite is true, the job.log is empty. What am I missing here?

FedKad avatar
cn flag
Can you try ... `2>>` ...?
Adam avatar
lr flag
@FedKad if use 2>> then I cannot see anything in terminal but its stored in the log file.
Adam avatar
lr flag
I am using this script: https://github.com/flathunters/flathunter/blob/main/flathunt.py
hr flag
See [Command output is not redirected to file](https://askubuntu.com/questions/1269712/command-output-is-not-redirected-to-file)
Adam avatar
lr flag
@steeldriver But in the linked script an info is logged not an error `self.__log__.info` https://github.com/flathunters/flathunter/blob/main/flathunter/config.py#L26 - so this does not answer my question, right?
hr flag
@Adam based on `help(logger)` it looks like the logger object's default handler writes to the error stream regardless of the message level (*"If stream is not specified, sys.stderr is used."*)
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.