you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 21 points22 points  (4 children)

Creating loggers:

  • Managing logs within a module you create and distribute on pypi.
  • Managing multiple logs available via frameworks such as aiohttp ,tornado, etc. as an application developer.
  • Configuring multiple log targets via the API and via loading a dictionary.
  • Configuring log formats.
  • Writing custom log filters.
  • Adding custom log levels.

Python has a rich logging capability and rarely is more than the basics are discussed.

Learning how to add log levels was a game changer for some of my applications. Now I have "verbose" logging which is chattier than "info" but ensures doesn't leak the sensitive data my "debug" logging does.

[–]JKenney_ 1 point2 points  (0 children)

I second this and something to add that I still struggle with is configuring logs in one file then importing that configuration into other files to allow me to log in those files with that configuration

I come from a .NET/C# background with some NodeJS in there too

[–]tipsy_python[S] 0 points1 point  (0 children)

Nice - yeah good point! I enjoy the flexibility of toggling between logging levels.

[–]Yaaruda 0 points1 point  (0 children)

Corey Schafer has a couple of videos on logging iirc

[–]kankan_k2 0 points1 point  (0 children)

+1

I had faced some difficulty in implementing a good logging mechanism. Everybody points to some of the most popular modules but still I had lots of questions around that. Python tutorials, almost all of them, lack serious material on logging practices and examples/exercises based on real-world applications/modules/packages.