Earlier quoted context omitted.
Some feedback from reading this page: - Why is your example logger named d? It might seem nitpicky but it's hard to read an example with a meaningless single character variable. - "d.close() # stop logging" - what is this? What does it mean to "stop logging" and why do I want to? - "Add a coroutine" - I would wager the lay Python developer doesn't even know what this word means. - lggr.Lggr() - Why not just name the…
Hi jwpeddle, thanks for all of the feedback! All of the changes I've made are on a branch called 'hn-fix' ( https://github.com/peterldowns/lggr/tree/hn-fix ) if you'd like to take a look. > Why is your example logger named d? It might seem nitpicky but > it's hard to read an example with a meaningless single character variable. No particular reason -- you're right, I will change this now. > "d.close() # stop logging"…
Python for Humans
31–40 of 74 posts
Re: Python for Humans
#32Earlier quoted context omitted.
Some feedback from reading this page: - Why is your example logger named d? It might seem nitpicky but it's hard to read an example with a meaningless single character variable. - "d.close() # stop logging" - what is this? What does it mean to "stop logging" and why do I want to? - "Add a coroutine" - I would wager the lay Python developer doesn't even know what this word means. - lggr.Lggr() - Why not just name the…
Hi jwpeddle, thanks for all of the feedback! All of the changes I've made are on a branch called 'hn-fix' ( https://github.com/peterldowns/lggr/tree/hn-fix ) if you'd like to take a look. > Why is your example logger named d? It might seem nitpicky but > it's hard to read an example with a meaningless single character variable. No particular reason -- you're right, I will change this now. > "d.close() # stop logging"…
Re: Python for Humans
#33Earlier quoted context omitted.
I'm not sure why you feel this niche requirement requires three question marks. The point of modules like this is to make it easier to do the tasks that 95% of developers are likely to need to do regularly, at the cost of not covering all rare use cases.
I think it is a fairly common requirement to use multiple IPs to avoid throttling or for APIs that restrict access to individual IPs. The fact that he was confused by it does not help his credibility when he is trying to tell people how to design their libraries.
Re: Python for Humans
#34Earlier quoted context omitted.
Hi jwpeddle, thanks for all of the feedback! All of the changes I've made are on a branch called 'hn-fix' ( https://github.com/peterldowns/lggr/tree/hn-fix ) if you'd like to take a look. > Why is your example logger named d? It might seem nitpicky but > it's hard to read an example with a meaningless single character variable. No particular reason -- you're right, I will change this now. > "d.close() # stop logging"…
Why not just add an atexit trap that automatically cleans up open logs? http://docs.python.org/2/library/atexit.html
Also, in accordance to the principle of "explicit is better than implicit," it's generally better to avoid messing with global state (such as atexit) behind the scenes, and to provide a way to shut down the logs manually.
Re: Python for Humans
#35Earlier quoted context omitted.
Hi jwpeddle, thanks for all of the feedback! All of the changes I've made are on a branch called 'hn-fix' ( https://github.com/peterldowns/lggr/tree/hn-fix ) if you'd like to take a look. > Why is your example logger named d? It might seem nitpicky but > it's hard to read an example with a meaningless single character variable. No particular reason -- you're right, I will change this now. > "d.close() # stop logging"…
Why not just add an atexit trap that automatically cleans up open logs? http://docs.python.org/2/library/atexit.html
Re: Python for Humans
#36Re: Python for Humans
#37A bit off-topic, but I couldn't find this and was very curious: What font are the slides using in the code snippets? It looks very clean--I didn't realize it was monospace at first.
Re: Python for Humans
#38Earlier quoted context omitted.
Some feedback from reading this page: - Why is your example logger named d? It might seem nitpicky but it's hard to read an example with a meaningless single character variable. - "d.close() # stop logging" - what is this? What does it mean to "stop logging" and why do I want to? - "Add a coroutine" - I would wager the lay Python developer doesn't even know what this word means. - lggr.Lggr() - Why not just name the…
Hi jwpeddle, thanks for all of the feedback! All of the changes I've made are on a branch called 'hn-fix' ( https://github.com/peterldowns/lggr/tree/hn-fix ) if you'd like to take a look. > Why is your example logger named d? It might seem nitpicky but > it's hard to read an example with a meaningless single character variable. No particular reason -- you're right, I will change this now. > "d.close() # stop logging"…
Re: Python for Humans
#39A bit off-topic, but I couldn't find this and was very curious: What font are the slides using in the code snippets? It looks very clean--I didn't realize it was monospace at first.
Re: Python for Humans
#40Slightly off topic: in an effort to become a better programmer, and to improve the Python ecosystem, I've tried to write a "for Humans" style logging library. Would anyone mind giving me feedback? http://peterdowns.com/lggr/
a few nit picks: i can't imagine a scenario where i'd want my logger to close stdout (or any other file descriptor) for me.
there is a lot of missing error handling, which is really important for something critical like a logger. what happens when disk space runs out? no timeouts on network operations?
also your SMTP and Gmail loggers don't form valid MIME messages (I can't log non-ascii?). you also seem to just swallow exceptions which is totally not what I would want or expect from a logging library.
keep at it though, the logging module's API (inspired by log4j) is fairly painful.