Subclassing logging.Formatter Changes Default Behavior of logging.Formatter
问题 I added two handlers with different formatters to my logger. The first one requires subclassing logging.Formatter to do custom formatting. The default formatter will suffice for the second handler. Let's say the first formatter simply removes newline characters from the message. The following script illustrates what seems like strange behavior: import logging logger = logging.getLogger(__name__) class CustomFormatter(logging.Formatter): def __init__(self, *args, **kwargs): super().__init__(