Source for information and screen shot from this logging ArjanCodes vid::

Python Logging: How to Write Logs Like a Pro!

Untitled

Debug is the broadest and includes Debug, Info, Warnings, Errors & Critical.

The messages start to narrow down the message stack, Info includes Info Warning, Error and Critical, and so forth.

Also, as a complete side note, notice how his main declaration includes that the function is a void function by indicating that it returns None with the return notation of → None in this case.

I think in order to make logging more useful the application would have to read the values being passed in to logging.basicConfig() from a TOML file instead of being hard coded like in the example above.

Source::

Python Logging: Getting Started, Best Practices, and More

Python comes with a built-in logging module, so you don’t need to install any packages to implement logging in your application. All you need to do is import the logging module, then set up a basic configuration using the logging.basicConfig() method. You use logging.{level}(output) to show the log message.

Questions::

It looks like one practice is or A practice is to set the parameters to logging.basicConfiguration() in the db and they can be set using app functionality like in a admin app view.

Untitled

The logging will then be slightly different than the default basicConfig. In that it will be more informative.

Untitled

Instead of these less informative logging messages::

Untitled

  1. How do we configure the name of the log?
  2. How do we configure where the log can be found?