Package epydoc :: Module log :: Class Logger
[hide private]
[frames] | no frames]

Class Logger
source code


An abstract base class that defines the interface for loggers, which are used by epydoc to report information back to the user. Loggers are responsible for tracking two types of information: This abstract class allows the command-line interface and the graphical interface to each present this information to the user in the way that's most natural for each interface. To set up a logger, create a subclass of Logger that overrides all methods, and register it using register_logger.

Instance Methods [hide private]
  log(self, level, message)
Display a message.
  start_block(self, header)
Start a new message block.
  end_block(self)
End a warning block.
  start_progress(self, header=None)
Begin displaying progress for a new task.
  end_progress(self)
Finish off the display of progress for the current task.
  progress(self, percent, message='')
Update the progress display.

Method Details [hide private]

log(self, level, message)

source code 
Display a message.
Parameters:
  • message - The message string to display. message may contain newlines, but does not need to end in a newline.
  • level - An integer value indicating the severity of the message.

start_block(self, header)

source code 
Start a new message block. Any calls to info, warn, or error that occur between a call to start_block and a corresponding call to end_block will be grouped together, and displayed with a common header. start_block can be called multiple times (to form nested blocks), but every call to start_block must be balanced by a call to end_block.

end_block(self)

source code 
End a warning block. See start_block for details.

start_progress(self, header=None)

source code 
Begin displaying progress for a new task. header is a description of the task for which progress is being reported. Each call to start_progress must be followed by a call to end_progress (with no intervening calls to start_progress).

end_progress(self)

source code 
Finish off the display of progress for the current task. See start_progress for more information.

progress(self, percent, message='')

source code 
Update the progress display.
Parameters:
  • progress - A float from 0.0 to 1.0, indicating how much progress has been made.
  • message - A message indicating the most recent action that contributed towards that progress.