0

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 ) ?

Bdfy
  • 23,141
  • 55
  • 131
  • 179

1 Answers1

2

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.