RotatingFileHandler

  • Thread starter Kamus of Kadizhar
  • Start date
K

Kamus of Kadizhar

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@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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top