Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Loguru sucks very badly! I would advise you not to use it. It is like trying to not do like everyone else, but still doing in a terribly wrong way ...

For example the backtrace try to be cooler for display but are awful, and totally not appropriate to pipe in monitoring systems like Sentry.

In the same way, as you can see in the article, that is the only logging library that doesn't accept the standard %-string syntax to use instead its own shitty syntax based on format.



The {} syntax is better, and more similar to f-strings. And you don't have to use that backtrace. I use it to send json for some batch jobs, or have it write to google cloud logger for gcp jobs. Are you holding it wrong?


It's totally subjective that it is better. It's not like it can "execute code" inline like f-string. Just the replacement character is the same, end of the comparison. And any way the point is that more that it totally breaks the general convention for no valid reason. It's not even optional.

For gcp jobs you can just output the structured log in the standard output so I don't see the purpose here. There are other structured logging libraries if this is what you need.

For the backtrace yes, because logging.exception will be broken by default and all tools that process the backtrace automatically like sentry. And again, for no valid reason except than "look, my traceback looks so much cooler on my screen because I added crap and new lines when printing it"...


I don’t care too much about % vs {} . I have stuff where i need nice logs locally, and structured logs in batch, for me loguru made that easy. I don’t think it’s a terrible thing at all, but you do you :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: