I am trying to reformat the output sent to the log based on this class.
For instance:
- Lines
- will be printed since they
- dictionaries / lists will be automatically indented / decorated in html
- my custom classes will be processed on an individual basis and converted to html
My problem is that the message sent to the formatter is always a string. The documentation states that you can send objects in the form of messages, but it looks like they convert the objects to strings before I can format them.
class MyFormatter(logging.Formatter): def format(self, record):
Where is the right place to handle objects sent as messages?
source share