Reputation: 3487
How do I stop logging
to create a log file when there is no log message? Currently, the logger has created an empty log when even no logging message to it. Use case is I created a FileHandler
that only log error (by logger.error("I am error!")
), but I don't want it to create a file when there is no error.
Upvotes: 4
Views: 707
Reputation: 24153
The documentation says to pass delay=True
to create the file on the first emit
call.
Upvotes: 3