Package Products :: Package ZenUtils :: Module Logger |
[hide private]
[frames] | no frames]

# Source Code for Module Products.ZenUtils.Logger

     1  ###########################################################################
     2  #
     3  # This program is part of Zenoss Core, an open source monitoring platform.
     4  # Copyright (C) 2007, Zenoss Inc.
     5  #
     6  # This program is free software; you can redistribute it and/or modify it
     7  # under the terms of the GNU General Public License version 2 as published by
     8  # the Free Software Foundation.
     9  #
    10  # For complete information please visit: http://www.zenoss.com/oss/
    11  #
    12  ###########################################################################
    13
    14  """Logger
    15
    16  Log messages from all confmon applications.  Logger
    17  will use the new python loggin stuff to route log
    18  nad filter messages.  This is also where
    19  lookups of error message translations happens.
    20
    21
    22  $Id: Logger.py,v 1.3 2002/07/19 17:02:41 edahl Exp $"""
    23
    24  __version__ = "$Revision: 1.3 $"[11:-2]
    25
    26  import time
    27
    28  FATAL = 5
    29  CRITICAL = 4
    30  WARNING = 3
    31  INFORMATION = 2
    32  DEBUG = 1
    33
    34  severities = (
    35              "NONE",
    36              "DEBUG",
    37              "WARNING",
    38              "CRITICAL",
    39              "FATAL"
    40              )
    41
    42 -def logger(level, message):
    43      """logger(level, message) -> log message with levl and time"""
    44      print time.asctime() + " " + severities[level] + ": " + message
    45