I have one registrar with several handlers that have their own formatting elements. Now I want to add padding, and the padding level is controlled at runtime. I want to receive messages from all handlers to get this indent. I tried to create it as a filter, but found that it looks like I cannot change the contents of the message. Then I tried this as formatting, but I can only have one handler. How to add such an indent without explicitly changing the formatting of each handler?
I have to mention that one of the formats that I have is a class that adds color to the output. This is not a simple format string.
In addition, I am using a configuration file. Ideally, I would like to be able to drive it mostly from there. However, I need to change the indentation formatting state (for example, set the indentation level), but I donβt know how to get to this particular formatting, as there is no logger.getFormatter("by_name") method.
To clarify, I need to access a specific instance of formatting, essentially, to adjust the format on the fly. An instance was created using logging.config from a file. I did not find any access methods that would allow me to get a specific formatter with his name.
source share