Python logging best practices

Simple logger setup for standalone scripts When I write a simple script in python I want to have a nicely formatted log messages. Therefore I change the default format so that service information (time, logger name, error level) has a fixed length. It helps me visually parse important information (log messages) from the stream of logs. It can be achieved by using fixed width modificators in format string: %(asctime)s|%(name)-20.20s|%(levelname)-5.5s|%(message)s More on logging format templates here....

April 21, 2015 · SergeM