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

Ticket #183 (defect)

Opened 4 years ago

Last modified 2 years ago

mistype in _cpLogMessage may cause runtime error

Status: closed (fixed)

Reported by: yuriwolf@hotbox.ru Assigned to: rdelon
Priority: normal Milestone:
Component: CherryPy code Keywords: mistype runtime
Cc:
def _cpLogMessage(msg, context = '', severity = 0):
    """ Default method for logging messages """

    nowTuple = time.localtime(time.time())
    nowStr = '%04d/%02d/%02d %02d:%02d:%02d' % (nowTuple[:6])

    if severity == 0:
        level = "INFO"
    elif severity == 1:
        level = "WARNING"
    elif severity == 2:
        level = "ERROR"
    else:
        '''lebel''' = "UNKNOWN"
    try:
        logToScreen = int(cpg.configOption.logToScreen)
    except:
        logToScreen = True
    s = nowStr + ' ' + context + ' ' + '''level''' + ' ' + msg
    if logToScreen:
        print s
    if cpg.configOption.logFile:
        f = open(cpg.configOption.logFile, 'ab')
        f.write(s + '\n')
        f.close()

Change History

06/22/05 00:08:58: Modified by fumanchu

  • status changed from new to closed.
  • resolution set to fixed.

Fixed in changeset [229].

03/19/07 22:08:23: Modified by fumanchu

  • description changed.

Hosted by WebFaction

Log in as guest/cpguest to create tickets