简体   繁体   中英

How to write messages in file from threads in twisted?

I want to write a custom log file this simple string, but log.msg write all events from script. How to made a third custom log file ? ( log.err, log.msg, log.custom ) ?

Have you seen the logging module? It allows you to log to several files at the same time. Or are you simply redirecting output from stdout? In that case, you could set sys.stdout to your own subclass of StringIO and override the write method to write to several files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM