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