-
Fixed:
- TelegramHandler re-grouped an already grouped message. Now messages are correctly grouped once.
- Handlers from all loggers other than the root were mistakenly added to the root's handlers.
This bug prevents the removal of handlers out of the root, thus the log message was doubled if another different handler was used. Now root's handlers are correctly added or removed (thank ZeroRin).
-
Usability:
- Multiprocessing:
- Changed the method of detecting child process, potentially fixing all issues related to multiprocessing and pyinstaller
- logger's server port now automatically picks up a random available port instead of
DEFAULT_TCP_LOGGING_PORT
. This means in the case of running many multiprocessing applications at the same time, the user doesn't need to care about theport
parameter anymore. Each application will pick its port, and its child processes will connect to the correct port, and thus log to the correct destination. - Added
server_timeout
argument tosetup_logging()
: allow the user to control how long should the log listener server
wait before exiting following the death of the main thread. - Added
client_only
argument tosetup_logging()
: enable different independent applications to log to the same destination.
- TelegramHandler: If the message is longer than 3072 characters, it will be split into parts and sent one by one.
This is to avoid reaching the Telegram API's limit of 4096 characters per message, which users should rarely reach. - Format styles: added support for
{
(string.format) and$
(string.Template) formats. The same style could be used acrossfomatter
's format and log message's format.
- Multiprocessing: