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

Source Code for Module Products.ZenUtils.Logger

 1  ############################################################################## 
 2  #  
 3  # Copyright (C) Zenoss, Inc. 2007, all rights reserved. 
 4  #  
 5  # This content is made available according to terms specified in 
 6  # License.zenoss under the directory where your Zenoss product is installed. 
 7  #  
 8  ############################################################################## 
 9   
10   
11  """Logger 
12   
13  Log messages from all confmon applications.  Logger 
14  will use the new python loggin stuff to route log 
15  nad filter messages.  This is also where 
16  lookups of error message translations happens. 
17   
18   
19  $Id: Logger.py,v 1.3 2002/07/19 17:02:41 edahl Exp $""" 
20   
21  __version__ = "$Revision: 1.3 $"[11:-2] 
22   
23  import time 
24   
25  FATAL = 5 
26  CRITICAL = 4 
27  WARNING = 3 
28  INFORMATION = 2 
29  DEBUG = 1 
30   
31  severities = ( 
32              "NONE",  
33              "DEBUG",  
34              "WARNING",  
35              "CRITICAL",  
36              "FATAL" 
37              ) 
38   
39 -def logger(level, message):
40 """logger(level, message) -> log message with levl and time""" 41 print time.asctime() + " " + severities[level] + ": " + message
42