-
Notifications
You must be signed in to change notification settings - Fork 6
Description
First, let me express my appreciation to you for this wonderful logging library. It's my pleasure to be the author of the first issue.
logger_tt helps me a lot. But I meet a problem.
I used to think that logger_tt.getLogger(name) will get a logger with same behavior with the logger_tt.logger, since they are configured by a global setup_logging.
However, I find that they behaves differently. For example, in the multi-processing case, the logger_tt.logger will add the process name to the logger, while logger_tt.getLogger(name) does not.
The behavior seems a little strange to me since there is only one global configuration there.
And when I want to set another formatter to the logger obtained by logger_tt.getLogger(name), the formatter seems not working. The codes are as follows:
logger = logger_tt.getLogger(name)
FORMAT = "%(asctime)s [$BOLD%(name)-20s$RESET][%(levelname)-18s] %(message)s ($BOLD%(filename)s$RESET:%(lineno)d)"
COLOR_FORMAT = formatter_message(FORMAT, True)
color_formatter = ColoredFormatter(COLOR_FORMAT)
for handler in logger.handlers:
handler.setFormatter(color_formatter)
return loggerCould you please help to look through this problem?