Skip to content
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

Allow logging timings to a logger #9

Open
dwighthubbard opened this issue Apr 7, 2016 · 5 comments
Open

Allow logging timings to a logger #9

dwighthubbard opened this issue Apr 7, 2016 · 5 comments

Comments

@dwighthubbard
Copy link

Would there be any reason not to allow an option to have the timeit decorator be able to log the information to a logger instead of sys.stderr?

@mgedmin
Copy link
Owner

mgedmin commented Apr 11, 2016

Hm. It never occurred to be me because profilehooks is basically a bunch of hacks for interactive debugging, while logging timings is something that smells of production use.

@dwighthubbard
Copy link
Author

Logging the timings in function calls is very useful for debugging things like web clients that may have intermittent errors.

@mgedmin
Copy link
Owner

mgedmin commented May 15, 2016

I'm thinking about what the interface should be like.

from profilehooks import timecall
@timecall(logger='loggername')

would work, but wouldn't it be tedious to repeat that every time?

@dwighthubbard
Copy link
Author

I did a fork where I implemented it basically like that https://github.com/dwighthubbard/profilehooks although I used log_name and log_level to specify the logging.

@mgedmin
Copy link
Owner

mgedmin commented May 17, 2016

Would you care to create a pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants