[issue8214] Add exception logging function to syslog module

2010-03-23 Thread Eric Smith
New submission from Eric Smith : Sean Reifschneider proposed [1] adding the ability to log an exception using the syslog module. My proposed implementation is along the lines of: def logexceptions(chain=True): import sys import traceback import syslog # Should we chain to the

[issue8214] Add exception logging function to syslog module

2010-03-23 Thread Eric Smith
Changes by Eric Smith : -- components: +Extension Modules ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http:/

[issue8214] Add exception logging function to syslog module

2010-03-24 Thread STINNER Victor
STINNER Victor added the comment: syslog_exception() should be declared outside logexceptions(), so it's possible to call it directly. Example: try: ... except Exception: syslog_exception(*sys.exc_info()) -- nosy: +haypo ___ Python tracker

[issue8214] Add exception logging function to syslog module

2010-03-25 Thread Eric Smith
Eric Smith added the comment: Good point. So that makes the implementation more like: import traceback import syslog import sys def syslog_exception(etype, evalue, etb): # The result of traceback.format_exception might contain # embedded newlines, so we have the nested loops. for l

[issue8214] Add exception logging function to syslog module

2010-03-25 Thread STINNER Victor
STINNER Victor added the comment: > Once it's moved into syslog, maybe syslog_exception named > syslog.log_exception. In that case, how would be called the second function? Can write a patch with an unit test? -- ___ Python tracker

[issue8214] Add exception logging function to syslog module

2010-03-25 Thread Eric Smith
Eric Smith added the comment: >> Once it's moved into syslog, maybe syslog_exception named >> syslog.log_exception. That's "should be named", of course. Although on second thought maybe syslog.syslog_exception really is the right name, to mirror syslog.syslog. > In that case, how would be ca

[issue8214] Add exception logging function to syslog module

2010-03-25 Thread STINNER Victor
STINNER Victor added the comment: > I'm not sure which second function you mean. "logexceptions" which replaces sys.excepthook. "log_exception" and "log_exceptions" are very close. cgitb has a function "enable" which sets sys.excepthook. -- ___ Py

[issue8214] Add exception logging function to syslog module

2010-03-25 Thread Eric Smith
Eric Smith added the comment: Ah, I see. Yes, logexceptions needs a better name. Maybe enable_exception_logging. -- ___ Python tracker ___ __

[issue8214] Add exception logging function to syslog module

2010-03-25 Thread Eric Smith
Eric Smith added the comment: Here's a version that would be more analogous to what the C implementation would look like. It uses a class instead of a closure to capture the "chain" value. The 2 exposed functions syslog_exception and enable_exception_logging are the new APIs in this proposal,

[issue8214] Add exception logging function to syslog module

2010-04-26 Thread Sean Reifschneider
Sean Reifschneider added the comment: I believe I have the first function implemented. See the attached patch for that code and feel free to review. -- keywords: +patch nosy: -haypo Added file: http://bugs.python.org/file17089/logexception.diff __

[issue8214] Add exception logging function to syslog module

2010-04-30 Thread Sean Reifschneider
Sean Reifschneider added the comment: I have completed the exception handling code as prototyped in msg101687. Please review. -- assignee: -> jafo keywords: +needs review stage: needs patch -> patch review Added file: http://bugs.python.org/file17159/logexception2.patch

[issue8214] Add exception logging function to syslog module

2010-05-01 Thread Sean Reifschneider
Sean Reifschneider added the comment: Jack Diederich commented: I don't have my tracker login on this computer so I'll post here. I'd +1 on making the module python with just the core functionality imported from C (it releases the GIL when doing IO). Then you could replace the few hundred line

[issue8214] Add exception logging function to syslog module

2010-05-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: Rewriting another implementation of traceback formatting in C is bad. Just import the "traceback" module and call the desired function in that module. -- nosy: +pitrou versions: -Python 2.7 ___ Python tracker

[issue8214] Add exception logging function to syslog module

2010-05-01 Thread Antoine Pitrou
Antoine Pitrou added the comment: Oh, well, sorry. That's what you are already doing. Forget me :) -- ___ Python tracker ___ ___ Pytho

[issue8214] Add exception logging function to syslog module

2010-05-01 Thread Sean Reifschneider
Sean Reifschneider added the comment: Thanks for the review Jack. I was very tempted to split it into C and Python components, but I decided against it because it's so close to the 2.7 release. I think it would be best to defer that for the Python 3 release, because of potential packaging issu

[issue8214] Add exception logging function to syslog module

2010-05-01 Thread Brian Curtin
Brian Curtin added the comment: The test file should use test_support.import_module("syslog") instead of the try/except, which would then make the skip decorators unnecessary. -- nosy: +brian.curtin ___ Python tracker

[issue8214] Add exception logging function to syslog module

2010-05-01 Thread Sean Reifschneider
Sean Reifschneider added the comment: Changed to use import_module. -- Added file: http://bugs.python.org/file17177/logexception4.patch ___ Python tracker ___ ___

[issue8214] Add exception logging function to syslog module

2010-05-01 Thread Benjamin Peterson
Benjamin Peterson added the comment: You shouln't use fail*. They're deprecated. -- nosy: +benjamin.peterson ___ Python tracker ___ __

[issue8214] Add exception logging function to syslog module

2010-05-01 Thread Sean Reifschneider
Sean Reifschneider added the comment: Switched to using assertTrue/assertFalse. -- Added file: http://bugs.python.org/file17179/logexception5.patch ___ Python tracker ___ ___

[issue8214] Add exception logging function to syslog module

2010-05-06 Thread Sean Reifschneider
Sean Reifschneider added the comment: This won't go into 2.7.0. I will do a patch for 3.x, and wait for 2.7.0 to see if it can go into 2.7.1. -- ___ Python tracker ___

[issue8214] Add exception logging function to syslog module

2010-05-06 Thread Sean Reifschneider
Sean Reifschneider added the comment: This won't go into 2.7.0. I will do a patch for 3.x, and wait for 2.7.0 to see if it can go into 2.7.1. -- ___ Python tracker ___

[issue8214] Add exception logging function to syslog module

2010-05-06 Thread Sean Reifschneider
Changes by Sean Reifschneider : -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailma

[issue8214] Add exception logging function to syslog module

2010-11-27 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho