RotatingFileHandler

Kamus of Kadizhar yan at NsOeSiPnAeMr.com
Thu Dec 2 15:04:31 EST 2004


I'm having a problem with logging.  I have an older app that used the
RotatingFileHandler before it became part of the main distribution (I
guess in 2.3).

It worked fine then.  Now I get:

[yan at hermes bin]# ./mplayer.py file://test.avi
//test.avi
Traceback (most recent call last):
  File "./mplayer.py", line 40, in ?
    logFile.emit(movieName)
  File "/usr/src/build/394694-i386/install/usr/lib/python2.3/logging/handlers.py", line 102, in emit
  File "/usr/src/build/394694-i386/install/usr/lib/python2.3/logging/__init__.py", line 567, in format
  File "/usr/src/build/394694-i386/install/usr/lib/python2.3/logging/__init__.py", line 362, in format
AttributeError: 'str' object has no attribute 'getMessage'

The offending snippet of code is:

   logFile = logging.handlers.RotatingFileHandler('/var/log/user/movies2.log','a',2000,4)
   logFile.emit(movieName)

I don't see anything wrong with this, but I'm a relative python bonehead.

movieName contains the string 'test.avi' at the time of the crash.

What's going on?  Anything I need to look at?

--Kamus

-- 
           o   |
 o__      >[]  | A roadie who doesn't ride a mountain bike has no soul.
 ,>/'_    /\   | But then a mountain biker who doesn't ride a road bike has no legs...
(_)\(_)   \ \  |                             -Doug Taylor, alt.mountain-bike




More information about the Python-list mailing list