simple question

Ajay abra9823 at mail.usyd.edu.au
Sun Sep 5 10:39:58 EDT 2004


hi!

i have created a logger
self.logger = logging.getLogger('smsapp')
hdlr = logging.FileHandler('logs/smsapp.log')
formatter = logging.Formatter ('%(asctime)s %(levelname)s %(message)s')
hdlr.setFormatter(formatter)
self.logger.addHandler(hdlr)
self.logger.setLevel(logging.DEBUG)

when i log an error
self.logger.error("Illegal date index, "  str(dateIndex))
i get an error in my code
Traceback (most recent call last):
  File "/usr/local/lib/python2.3/logging/__init__.py", line 674, in emit
    msg = self.format(record)
  File "/usr/local/lib/python2.3/logging/__init__.py", line 567, in format
    return fmt.format(record)
  File "/usr/local/lib/python2.3/logging/__init__.py", line 362, in format
    record.message = record.getMessage()
  File "/usr/local/lib/python2.3/logging/__init__.py", line 233, in
getMessage
    msg = msg % self.args
TypeError: not all arguments converted during string formatting

dateIndex is an int

thanks

cheers


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



More information about the Python-list mailing list