On 26/05/20 8:26 AM, zljubi...@gmail.com wrote:
Hi,

I have a case in which I have to use custom function for logging.
For example, all messages should go to stderr and end with '\r\n'.

Can I somehow use standard python logging module but send all message to stderr 
with '\r\n' line endings?


- use a logging formatter (with the below, linesep) to construct log.msgs (and their endings) - use the logging library's helper function to direct log.msgs to stderr (or wherever)


os.linesep in The Python Standard Library: os — Miscellaneous operating system interfaces
https://docs.python.org/3/library/os.html


stderr is the default destination for logging
Logging HOWTO https://docs.python.org/3/howto/logging.html
https://docs.python.org/3/library/logging.html

--
Regards =dn
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to