-
Notifications
You must be signed in to change notification settings - Fork 1k
logging: support for file based logging #277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
try: | ||
os.remove(log_file) | ||
except OSError: | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it good approach to silently pass error?
logging.info("%d %s" % (i, sample)) | ||
stdout_delta = time.time() - start_time | ||
print("File logging time %f for %i iterations" % (file_delta, iterations)) | ||
print("Stdout logging time %f for %i iterations" % (stdout_delta, iterations)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you want to put this function in example ?
print(msg, file=_stream) | ||
else: | ||
print(msg % args, file=_stream) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we write to stream and file in same time?
File based logging was added in #507. |
Added basic file logging support
Added unittest for basicConfig when using files
Added stress test for logging to file and std stream