Re: [Tutor] Logging module

2008-05-10 Thread Dick Moores
At 02:03 PM 5/10/2008, Martin Walsh wrote: Dick Moores wrote: > But how to use the logging module to log the report of the screw up? > Right now I don't care about the various levels. I just want to get > something into a log file. > > Hellmann suggest this: > > import logging > LOG_FILENAME = '/

Re: [Tutor] Logging module

2008-05-10 Thread Martin Walsh
Dick Moores wrote: > But how to use the logging module to log the report of the screw up? > Right now I don't care about the various levels. I just want to get > something into a log file. > > Hellmann suggest this: > > import logging > LOG_FILENAME = '/tmp/logging_example.out' > logging.basicCon

[Tutor] Logging module

2008-05-10 Thread Dick Moores
I don't understand how to use this. I've read and . I thought I'd try with a script that screws up: a = "qwerty" b = a*b But how to use the logging module to log the report of the screw

Re: [Tutor] Logging module

2007-07-25 Thread Tiger12506
> I found the problem. It was rather simple actually. I didn't have remote > logging enabled for syslog. Even though I was logging to localhost, for > some reason, it wouldn't work until I gave syslogd a -r at startup. > Thanks localhost is still remote, in that sockets are used to reach it. Th

Re: [Tutor] Logging module

2007-07-25 Thread jay
Thanks for the reply Kent. I found the problem. It was rather simple actually. I didn't have remote logging enabled for syslog. Even though I was logging to localhost, for some reason, it wouldn't work until I gave syslogd a -r at startup. Thanks jay On 7/25/07, Kent Johnson <[EMAIL PROTECTE

Re: [Tutor] Logging module

2007-07-25 Thread Kent Johnson
jay wrote: > Hello, > > I'm trying to setup simple Syslog logging in python using the logging > module. I would like to use a config file, but so far haven't been able > to get the correct configuration. Actually, I don't get any warnings or > errors, program runs fine, but nothing is logged

[Tutor] Logging module

2007-07-24 Thread jay
Hello, I'm trying to setup simple Syslog logging in python using the logging module. I would like to use a config file, but so far haven't been able to get the correct configuration. Actually, I don't get any warnings or errors, program runs fine, but nothing is logged anywhere. I have my sysl

Re: [Tutor] logging module, how to print line numbers?

2006-09-01 Thread Kent Johnson
Hans Fangohr wrote: > Hi Kent (and others), > > On 01/09/06, Kent Johnson <[EMAIL PROTECTED]> wrote: > >> How are you running the program? What OS? What Python (2.3.??) >> > This is python 2.3.5 on Debian etch. Same results with python 2.4.4 on > Debian etch (although 'the linenumber' is 10

Re: [Tutor] logging module, how to print line numbers?

2006-08-31 Thread Hans Fangohr
Hi Kent, > > I have some trouble with the logging module. > > > > When I run this program with python2.3: > > > > # > > import logging,sys > > formatter = logging.Formatter('%(name)s :%(asctime)s %(filename)s > > %(lineno)s %(levelname)s %(message)s') > > stdout_handler = logging.Stre

Re: [Tutor] logging module, how to print line numbers?

2006-08-31 Thread ralf . steckel
Dear Hans, i haven't worked with the logging module yet but as a guess from what you write in your message: according to the documentation the format statement for lineno should be %(lineno)d, but you use %(lineno)s. Best regards, Ralf > Hi, > > I have some trouble with the logging module.

Re: [Tutor] logging module, how to print line numbers?

2006-08-31 Thread Kent Johnson
Hans Fangohr wrote: > Hi, > > I have some trouble with the logging module. > > When I run this program with python2.3: > > # > import logging,sys > formatter = logging.Formatter('%(name)s :%(asctime)s %(filename)s > %(lineno)s %(levelname)s %(message)s') > stdout_handler = logging.Stre

[Tutor] logging module, how to print line numbers?

2006-08-31 Thread Hans Fangohr
Hi, I have some trouble with the logging module. When I run this program with python2.3: # import logging,sys formatter = logging.Formatter('%(name)s :%(asctime)s %(filename)s %(lineno)s %(levelname)s %(message)s') stdout_handler = logging.StreamHandler(sys.stdout) stdout_handler.se