Two line logged for each statement?
See original GitHub issuefrom loguru import logger
logger.add(sys.stdout, colorize=True, backtrace=True, diagnose=True, format="<green>{time}</green> <level>{message}</level>")
if __name__ == "__main__":
txt = "This is test text"
logger.debug("{}", txt)
logger.debug("End")
My terminal output looks like
Not sure why it wants to output two rows per log
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
How to Collect and Manage All of Your Multi-Line Logs
We will go over two primary methods for collecting and processing multi-line logs in a way that aggregates them as single events:.
Read more >Styling multi-line conditions in 'if' statements? [closed]
I suggest moving the and keyword to the second line and indenting all lines containing conditions with two spaces instead of four:
Read more >Q17 Complete each statement with the... [FREE SOLUTION]
Two skew lines are parallel. Complete each statement with the word always, sometimes, or never. Lines in two parallel planes are parallel to...
Read more >Solved Determine whether each statement is true or false. 1.
2. Two lines perpendicular to a third line are parallel. 3. Two planes parallel to a third plane are parallel. 4. Two planes...
Read more >Determine whether each statement is true or false in R3 (a ...
j) Two lines either intersect or are parallel . (k) A plane and a line either intersect or are parallel. 2) Find a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@jamesstidard The standard
logging
is not always straightforward to work with, I would blame that instead. 😄It seems you need first to remove the Sanic’s handler:
For some libraries, this extra-step is not required. I’m not sure of why, I guess it depends on how these libraries configure
logging
internally.Sanic
seems to attach their ownstderr
handler tologging.getLogger("sanic.root")
. There is a bit of documentation there: Sanic Logging@Delgan ah, that makes a lot of sense. Sorry, I didn’t think to check out the doc string on the function apparently… probably should have figured that out.
Not to take advantage of your good will, but adding the remove call does indeed get rid of the duplicate lines, but not the ones I was hoping 😃
Without the remove line this outputs:
With the remove line, it drops the pretty loguru ones in favor of the default. It’s still the morning here so I’ll continue to blame it on that 😃
Thanks for the help.