Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 2168

Show
Ignore:
Timestamp:
03/30/09 11:21:35
Author:
stefan
Message:

Replaced rfc822 with email.utils, and added a monthnames-list

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/python3/cherrypy/_cplogging.py

    r2158 r2168  
    77logfmt = logging.Formatter("%(message)s") 
    88import os 
    9 import rfc822 
     9import email.utils  
    1010import sys 
    1111 
     
    108108        """Return now() in Apache Common Log Format (no timezone).""" 
    109109        now = datetime.datetime.now() 
    110         month = rfc822._monthnames[now.month - 1].capitalize() 
     110        monthnames = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 
     111               'aug', 'sep', 'oct', 'nov', 'dec', 
     112               'january', 'february', 'march', 'april', 'may', 'june', 'july', 
     113               'august', 'september', 'october', 'november', 'december'] 
     114        month = monthnames[now.month - 1].capitalize() 
    111115        return ('[%02d/%s/%04d:%02d:%02d:%02d]' % 
    112116                (now.day, month, now.year, now.hour, now.minute, now.second)) 

Hosted by WebFaction

Log in as guest/cpguest to create tickets