AIGO.utils.Logger
index
/home/dpm/projects/AIGO-0.1.0/AIGO/utils/Logger.py

 
Modules
       
datetime
os
sys
time
traceback

 
Classes
       
LogProgress
Logger

 
class LogProgress
    ## Class to handle percent logging to terminal.  Note that once you call update for the first time,
Logger info messages will be suppressed until you call finished.
# p = LogProgress(totalsize)
# p.update() # run many times
# p.finished()
 
  Methods defined here:
__init__(self, size)
age(self)
finished(self)
prettyTime(self, seconds)
update(self)

 
class Logger
     Methods defined here:
__init__(self, loglevel=0)
## Constructor (makes a new instance, but state is shared across all instances)
# @param loglevel (default of 0):
# \li 0 - turns off logging - raise RuntimeErrors/Warnings for fatal/warning messages (useful for code build on this library)
# \li 1 - print only fatal messages
# \li 2 - print warnings and fatal messages
# \li 3 - info mode - prints everything
handleFatal(self, fatal, exception=False)
## Log a message concerning a fatal error that will cause this program to terminate.  The function then
# terminates the program.
# @param fatal The message containing a description of the fatal conditions.
# @param exception If true this method will print the last stacktrace as well
handleWarning(self, error, exception=False)
## Log a warning message (bad, but not bad enough to stop the program)
# @param error Error message to log
# @param exception If true this method will print the last stacktrace as well
info(self, msg, singleline=False)
## Log a info message
# @param msg information message to log
printExceptionStack(self)
## Print the most recent exception's stacktrace
timenow(self)

Data and other attributes defined here:
FATAL = 1
INFO = 3
NONE = 0
WARNING = 2