Skip to content

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

Closed
wants to merge 5 commits into from

Conversation

opreab
Copy link

@opreab opreab commented May 6, 2018

Added basic file logging support
Added unittest for basicConfig when using files
Added stress test for logging to file and std stream

try:
os.remove(log_file)
except OSError:
pass

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

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)

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?

@jimmo
Copy link
Member

jimmo commented Jul 21, 2023

File based logging was added in #507.

@jimmo jimmo closed this Jul 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants