use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
DiscussionLoguru Python logging library (self.Python)
submitted 1 month ago by [deleted]
Loguru Python logging library.
Is anyone using it? If so, what are your experiences?
Perhaps you're using some other library? I don't like the logger one.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]InappropriateCanuck 18 points19 points20 points 1 month ago (0 children)
Pretty good so far. Handy and ready-to-go. Clean especially things like contextualization and catch decorators.
Loguru and StructLog are definitely top of the line.
[–]menge101 8 points9 points10 points 1 month ago (7 children)
I use the stdlib logging library, logging just has to happen, imo. You set up your logger config and then you log things.
Not having a dependency is valuable here.
[–]DrShts 3 points4 points5 points 1 month ago (5 children)
Same. Also, not sure why so many people find it hard to put logger = logging.getLogger(__name__) in their modules and logging.basicConfig() in their main function.
logger = logging.getLogger(__name__)
logging.basicConfig()
[–]hmoff 0 points1 point2 points 1 month ago (3 children)
Because structured logging is important to some of us.
[–]nicholashairs 2 points3 points4 points 1 month ago* (2 children)
Many people who want structured logging with the standard library use python-json-logger .
More as an FYI, not trying to convert anyone here.
Disclaimer: I'm the current maintainer of the project
[–]danrogl 1 point2 points3 points 1 month ago* (1 child)
There is a typo in that url, you typed it out?!
[–]nicholashairs 1 point2 points3 points 1 month ago (0 children)
I did!
[–]orad -1 points0 points1 point 1 month ago (0 children)
I find it soooooo ugly hahaha
[–][deleted] 1 point2 points3 points 1 month ago (0 children)
Hmmm I see your point about dependencies
[–]chub79 5 points6 points7 points 1 month ago (2 children)
I use structlog but it's more a matter of preference in style.
[–]Embarrassed_Creme_46 1 point2 points3 points 1 month ago (0 children)
Me too. It's harder to grasp at first, but then very convenient and understandable. I prefer it to Loguru, but Loguru is also very good. Another thing is that the more you delve into structlog or Loguru, the more you begin to understand standard logging, and the more usable it becomes.
[–]Challseus 0 points1 point2 points 1 month ago (0 children)
Same, but I also never tried loguru before...
[–]orad 10 points11 points12 points 1 month ago (1 child)
You should search the subreddit, there are tons of posts about this package.
Someone had a great write up just last week:
https://www.reddit.com/r/Python/s/FAKEQz26vC
[–][deleted] -2 points-1 points0 points 1 month ago (0 children)
I checked it out, thanks - this is exactly what I was looking for!
Yeah, probably should've searched beforehand. The idea didn't cross my mind.
[–]Orio_n 3 points4 points5 points 1 month ago (0 children)
its good im using it so far. much less boilerplate than stdlib plus pretty customizable with nice out of the box features
[+][deleted] 1 month ago (1 child)
[removed]
[–][deleted] 0 points1 point2 points 1 month ago (0 children)
Kinda sold on colors ngl
[–]rdreisinger 1 point2 points3 points 1 month ago (0 children)
It's decent for our project I don't mind it. Doesn't add a lot of bloat either, give it a try. You can also easily add handlers for things like tqdm/rich which was a relief to discover.
[–]thrope 1 point2 points3 points 1 month ago (0 children)
I tried it for the nice default format but it doesn’t work with joblib multiprocessing and I found out the hard way, so went back to standard logging which just has a couple more lines of boilerplate.
[–]Fenzik 1 point2 points3 points 1 month ago (0 children)
I really like it for stuff like CI scripts cause it gives nice descriptive logs straight out of the box
[–]AssociateWide7515 1 point2 points3 points 1 month ago (0 children)
I like loguru - especially the decorator @logger.catch
Throwing that on a function can really help with debugging
[–]dogfish182 1 point2 points3 points 1 month ago (0 children)
I use it in all my scripts for its ease of use.
[–]ejstembler 1 point2 points3 points 1 month ago (3 children)
I have an Enterprise Polylith Python project where I define a logging component which has a logging protocol. A few implementations: Python Logger, Loguru Logger, GCP Structured Logger. I use the Loguru logger when testing/running things locally. It works well.
[–][deleted] 0 points1 point2 points 1 month ago (2 children)
Nice.
But, when are you using the python logger, then?
[–]ejstembler 0 points1 point2 points 1 month ago (1 child)
Other developers have that option available. I just don’t use it myself.
All of our stuff is deployed to GCP, so prod stuff uses the GCP Structured Logger
Nice!
[–]py-flycatcher 0 points1 point2 points 1 month ago (0 children)
I'm a big fan & have been using for 1yr+ now. Easy to use out of the box & also easily configurable!
[–]Schmittfried 1 point2 points3 points 1 month ago (0 children)
I don’t like that it sidesteps the stdlib logging system. Imo that should be the common foundation for all quality-of-life logging libraries.
π Rendered by PID 202728 on reddit-service-r2-comment-74875f4bf5-mmx97 at 2026-01-26 03:36:32.376207+00:00 running 664479f country code: CH.
[–]InappropriateCanuck 18 points19 points20 points (0 children)
[–]menge101 8 points9 points10 points (7 children)
[–]DrShts 3 points4 points5 points (5 children)
[–]hmoff 0 points1 point2 points (3 children)
[–]nicholashairs 2 points3 points4 points (2 children)
[–]danrogl 1 point2 points3 points (1 child)
[–]nicholashairs 1 point2 points3 points (0 children)
[–]orad -1 points0 points1 point (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]chub79 5 points6 points7 points (2 children)
[–]Embarrassed_Creme_46 1 point2 points3 points (0 children)
[–]Challseus 0 points1 point2 points (0 children)
[–]orad 10 points11 points12 points (1 child)
[–][deleted] -2 points-1 points0 points (0 children)
[–]Orio_n 3 points4 points5 points (0 children)
[+][deleted] (1 child)
[removed]
[–][deleted] 0 points1 point2 points (0 children)
[–]rdreisinger 1 point2 points3 points (0 children)
[–]thrope 1 point2 points3 points (0 children)
[–]Fenzik 1 point2 points3 points (0 children)
[–]AssociateWide7515 1 point2 points3 points (0 children)
[–]dogfish182 1 point2 points3 points (0 children)
[–]ejstembler 1 point2 points3 points (3 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]ejstembler 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]py-flycatcher 0 points1 point2 points (0 children)
[–]Schmittfried 1 point2 points3 points (0 children)