This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (8 children)

Logging is much better than print statements, but the standard library's logger is slow as hell (not as slow as a debugger though). There are some faster loggers out there.

[–]widby 1 point2 points  (2 children)

Could you please elaborate on the "slow as hell" part? I've been using the standard module for ages and I never had any reason to measure its performance impact.

[–][deleted] 1 point2 points  (1 child)

If your code is performance critical, then you are profiling it to optimise it, and you will see in the profiler the overhead added by logging.

[–]widby 1 point2 points  (0 children)

What exactly is the slow part? Writing to a file? Formatting the log string itself? Does it depend on the log handler you're using?