4

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.

1 Answer 1

3

The documentation says to pass delay=True to create the file on the first emit call.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.