Mayil-AI-Sandbox / loguru-Jan2023

MIT License
0 stars 0 forks source link

Question about logger message (hashtag657) #66

Closed vikramsubramanian closed 2 weeks ago

vikramsubramanian commented 2 weeks ago

I am using loguru to log info level information out of an app. I call logger.info from a main function and then from some other functions. The format for all of these is "logger.info(f'Extracting {item} rank from string: {rank}')" though the couple of calls to logger.info in my main function don't use f strings, they are just like "logger.info('Processing complete')". In the calls outside of main, what ends up in my log file looks like this:

05-13-22 at 12:45 | INFO | myapp.py:462 | Extracting ABC4322 rank from string: hashtag360 in

In main, they look like this:

05-13-22 at 12:45 | INFO | myapp.py:667 | Processing complete.

My question is where does that "in" at the end of my first example come from? Should I be putting something in my logger.info() call to pass in the name of the module I'm in or what? I just don't get why I see that "in" in only some of my logger.info() calls.

Thanks for any insight--

Al

vikramsubramanian commented 2 weeks ago

The "in" is probably part of your rank variable or is somehow added by a custom formatter of your sink. It could also maybe being a third library writing concurrently to stderr.

I can't help more without knowing your logging configuration. One thing is for sure, Loguru does not add "in" by itself. ;)

vikramsubramanian commented 2 weeks ago

Feel free to re-open this ticket if your issue isn't solved.