dstrohl / Python_log_indenter

A python helper class that provides additional log formatting such as indenting, counters.
GNU General Public License v2.0
4 stars 1 forks source link

Python Log Indenter Helper Class

A python helper class that provides automatic indenting for logging.

This will allow you to turn logs that would normally look like this::

root    DEBUG   Loading system
root    DEBUG   Checking for the right record
root    DEBUG   Checking record 1
root    DEBUG   Checking name
root    DEBUG   Not the right record
root    DEBUG   Checking record 2
root    DEBUG   checking name
root    DEBUG   Name checks, checking phone number
root    DEBUG   Phone number checks, VALID record!
root    DEBUG   Returning record 2

Into something like this::

root    DEBUG   Loading system
root    DEBUG       Checking for the right record
root    DEBUG           Checking record 1
root    DEBUG               Checking name
root    DEBUG                   Not the right record
root    DEBUG           Checking record 2
root    DEBUG               checking name
root    DEBUG                   Name checks, checking phone number
root    DEBUG               Phone number checks, VALID record!
root    DEBUG           Returning record 2