logging
index
/home/groups/p/py/pywebsvcs/src/wstools/logging.py

Logging

 
Modules
       
os
sys

 
Classes
       
ILogger
BasicLogger
GridLogger
__builtin__.dict(__builtin__.object)
GLRecord

 
class BasicLogger(ILogger)
     Methods defined here:
__init__(self, msg, out=<open file '<stdout>', mode 'w'>)
debug(self, msg, *args, **kw)
error(self, msg, *args, **kw)
warning(self, msg, *args, **kw)
write(self, *args)
Write convenience function; writes strings.

Data and other attributes defined here:
DEBUG = '[DEBUG]'
ERROR = '[ERROR]'
WARN = '[WARN]'
last = ''

Methods inherited from ILogger:
debugOn lambda self
warnOn lambda self

Class methods inherited from ILogger:
setLevel(cls, level) from __builtin__.classobj

Data and other attributes inherited from ILogger:
level = 0

 
class GLRecord(__builtin__.dict)
    Grid Logging Best Practices Record, Distributed Logging Utilities
 
The following names are reserved:
 
event -- log event name
    Below is EBNF for the event name part of a log message.
        name        = <nodot> ( "." <name> )? 
        nodot       = {RFC3896-chars except "."}
 
    Suffixes:
        start: Immediately before the first action in a task.
        end: Immediately after the last action in a task (that succeeded).
        error: an error condition that does not correspond to an end event.
 
ts -- timestamp
level -- logging level (see levels below)
status -- integer status code
gid -- global grid identifier 
gid, cgid -- parent/child identifiers
prog -- program name
 
 
More info: http://www.cedps.net/wiki/index.php/LoggingBestPractices#Python
 
reserved -- list of reserved names, 
omitname -- list of reserved names, output only values ('ts', 'event',)
levels -- dict of levels and description
 
 
Method resolution order:
GLRecord
__builtin__.dict
__builtin__.object

Methods defined here:
__init__(self, date=None, **kw)
__str__(self)

Data and other attributes defined here:
GLDate = <class 'logging.GLDate'>
Grid logging Date Format
all timestamps should all be in the same time zone (UTC). 
Grid timestamp value format that is a highly readable variant of the ISO8601 time standard [1]:
 
YYYY-MM-DDTHH:MM:SS.SSSSSSZ
__dict__ = <dictproxy object>
dictionary for instance variables (if defined)
__weakref__ = <attribute '__weakref__' of 'GLRecord' objects>
list of weak references to the object (if defined)
format = {<type 'float'>: <function <lambda>>, <type 'int'>: <type 'str'>, <type 'long'>: <type 'str'>, <type 'str'>: <function <lambda>>, <type 'unicode'>: <type 'str'>, <class 'logging.GLDate'>: <type 'str'>}
levels = {'ALERT': 'Action must be taken immediately.', 'CRITICAL': 'Critical conditions (on the system).', 'DEBUG': 'Lower level information concerning program logic decisions, internal state, etc.', 'ERROR': 'Errors in the component; not errors from elsewhere.', 'FATAL': 'Component cannot continue, or system is unusable.', 'INFO': 'Informational messages that would be useful to a deployer or administrator.', 'NOTICE': 'Normal but significant condition.', 'TRACE': 'Finest granularity, similar to "stepping through" the component or system.', 'WARNING': 'Problems that are recovered from, usually.'}
omitname = ()
reserved = ('ts', 'event', 'level', 'status', 'gid', 'prog')

Methods inherited from __builtin__.dict:
__cmp__(...)
x.__cmp__(y) <==> cmp(x,y)
__contains__(...)
x.__contains__(y) <==> y in x
__delitem__(...)
x.__delitem__(y) <==> del x[y]
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__iter__(...)
x.__iter__() <==> iter(x)
__le__(...)
x.__le__(y) <==> x<=y
__len__(...)
x.__len__() <==> len(x)
__lt__(...)
x.__lt__(y) <==> x<y
__ne__(...)
x.__ne__(y) <==> x!=y
__repr__(...)
x.__repr__() <==> repr(x)
__setitem__(...)
x.__setitem__(i, y) <==> x[i]=y
clear(...)
D.clear() -> None.  Remove all items from D.
copy(...)
D.copy() -> a shallow copy of D
get(...)
D.get(k[,d]) -> D[k] if k in D, else d.  d defaults to None.
has_key(...)
D.has_key(k) -> True if D has a key k, else False
items(...)
D.items() -> list of D's (key, value) pairs, as 2-tuples
iteritems(...)
D.iteritems() -> an iterator over the (key, value) items of D
iterkeys(...)
D.iterkeys() -> an iterator over the keys of D
itervalues(...)
D.itervalues() -> an iterator over the values of D
keys(...)
D.keys() -> list of D's keys
pop(...)
D.pop(k[,d]) -> v, remove specified key and return the corresponding value
If key is not found, d is returned if given, otherwise KeyError is raised
popitem(...)
D.popitem() -> (k, v), remove and return some (key, value) pair as a
2-tuple; but raise KeyError if D is empty
setdefault(...)
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
update(...)
D.update(E) -> None.  Update D from E: for k in E.keys(): D[k] = E[k]
values(...)
D.values() -> list of D's values

Data and other attributes inherited from __builtin__.dict:
__new__ = <built-in method __new__ of type object>
T.__new__(S, ...) -> a new object with type S, a subtype of T
fromkeys = <built-in method fromkeys of type object>
dict.fromkeys(S[,v]) -> New dict with keys from S and values equal to v.
v defaults to None.

 
class GridLogger(ILogger)
     Methods defined here:
debug(self, msg, *args, **kw)
error(self, msg, *args, **kw)
warning(self, msg, *args, **kw)

Methods inherited from ILogger:
__init__(self, msg)
debugOn lambda self
warnOn lambda self

Class methods inherited from ILogger:
setLevel(cls, level) from __builtin__.classobj

Data and other attributes inherited from ILogger:
level = 0

 
class ILogger
    Logger interface, by default this class
will be used and logging calls are no-ops.
 
  Methods defined here:
__init__(self, msg)
debug(self, *args, **kw)
debugOn lambda self
error(self, *args, **kw)
warnOn lambda self
warning(self, *args, **kw)

Class methods defined here:
setLevel(cls, level) from __builtin__.classobj

Data and other attributes defined here:
level = 0

 
Functions
       
getLevel()
getLogger(msg)
Return instance of Logging class.
gridLog(**kw)
Send GLRecord, Distributed Logging Utilities
If the scheme is passed as a keyword parameter
the value is expected to be a callable function
that takes 2 parameters: url, outputStr
 
GRIDLOG_ON   -- turn grid logging on
GRIDLOG_DEST -- provide URL destination
sendUDP(url, outputStr)
setBasicLogger()
Use Basic Logger.
setBasicLoggerDEBUG()
Use Basic Logger.
setBasicLoggerWARN()
Use Basic Logger.
setGridLogger()
Use GridLogger for all logging events.
setLevel(level=0)
Set Global Logging Level.
setLoggerClass(loggingClass)
Set Logging Class.
writeToFile(url, outputStr)

 
Data
        DEBUG = 2
GLRegistry = {'file': <function writeToFile>, 'gridlog-udp': <function sendUDP>}
WARN = 1
ident = '$Id: logging.py 1395 2007-06-14 06:49:35Z boverhof $'