pyCloudy  0.8.33
manage Cloudy photoionization code
my_logging Class Reference

Logging tool. More...

List of all members.

Public Member Functions

def __init__
def debug
def message
def warn
def error
def timer
def print_messages
def print_warnings
def print_errors
def print_timer
def open_file
def close_file

Public Attributes

 log_
 caller_max_size
 level
 calling
 print_time
 no_exit

Detailed Description

Logging tool.

Logging object that can log events with 3 different types (messages, warnings and error).
Date and time are save as well as the calling procedure.
events are printed in the standard output depending on the verbosity level.
level : -1: Quiet and no log into log_ variable
         0: Quiet
         1: Only Errors
         2: Errors and Warnings
         3: very verbose, print Errors, Warnings and Messages 
         4: debug


Constructor & Destructor Documentation

def __init__ (   self,
  level = None,
  calling = None,
  file_ = None,
  print_time = False,
  no_exit = True 
)
Parameters:
    - level [int] 0, 1, 2, 3, or 4
    - calling [str] description of the calling module
    - file_ [str] file to store the events (default is None).
    - print_time [boolean] if True, the event is printed with date-time (Default is False).


Member Function Documentation

def close_file (   self)
Close the output file and avoid printing to it.
def debug (   self,
  message,
  calling = None 
)
method to add a debug message to the log                
param:
    message [str] string to log
def error (   self,
  message,
  calling = None,
  exception = None 
)
method to add an error to the log
param:
    message [str] string to log
def message (   self,
  message,
  calling = None 
)
method to add a message to the log
param:
    message [str] string to log
def open_file (   self,
  file_ 
)
Open the file for the output and allow printing to it.
param:
    file_ [str] file to save the log events.
def print_errors (   self)
print all the errors.
def print_messages (   self)
print all the messages.
def print_timer (   self)
print the timer messages.
def print_warnings (   self)
print all the warnings.
def timer (   self,
  message,
  quiet = False,
  calling = None 
)
method to add a timer to the log. Print the time elapsed since last call of timer (or instanciation
of the object if first call).
param:
    message [str] string to log
    quiet [boolean] if True, no message printed (but timer reset)
def warn (   self,
  message,
  calling = None 
)
method to add a warning to the log                
param:
    message [str] string to log

Member Data Documentation