Package libavg :: Module avg :: Class Logger

Class Logger




Interface to the logger used by the avg player. Enables the setting of different logging categories. Log output can be sent to the console, a file or unix syslog. Each log entry contains the time the message was written, the category of the entry and the message itself.

Instance Methods
 
__init__(...)
Raises an exception This class cannot be instantiated from Python
 
setCategories(...)
Sets the types of messages that should be logged.
 
setConsoleDest(...)
Sets the log to be output to the console (stderr, to be precise).This is the default.
 
setFileDest(...)
Sets a file that the log should be written to.
 
setSyslogDest(...)
Causes log output to be written to the unix system log facility.
 
trace(...)
Logs message to the log if category is active.

Inherited from unreachable.instance: __new__

Inherited from object: __delattr__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Static Methods
 
get(...)
This method gives access to the logger.
Properties
  APP
  BLTS
  CONFIG
  ERROR
  EVENTS
  EVENTS2
  MEMORY
  NONE
  PROFILE
  PROFILE_LATEFRAMES
  WARNING

Inherited from object: __class__

Method Details

__init__(...)
(Constructor)

 
Raises an exception This class cannot be instantiated from Python
Overrides: object.__init__

get(...)
Static Method

 
This method gives access to the logger. There is only one instance.

setCategories(...)

 
Sets the types of messages that should be logged.
Parameters:
  • categories - Or'ed list of categories. Possible categories are:
    • NONE: No logging except for errors.
    • BLTS: Display subsystem logging. Useful for timing/performance measurements.
    • PROFILE: Outputs performance statistics on player termination.
    • PROFILE_LATEFRAMES: Outputs performance statistics whenever a frame is displayed late.
    • EVENTS: Outputs basic event data.
    • EVENTS2: Outputs all event data available.
    • CONFIG: Outputs configuration data.
    • WARNING: Outputs warning messages. Default is on.
    • ERROR: Outputs error messages. Can't be shut off.
    • MEMORY: Outputs open/close information whenever a media file is accessed.
    • APP: Reserved for application-level messages issued by python code.

setFileDest(...)

 
Sets a file that the log should be written to. If opening the file fails, the console is used instead.
Parameters:
  • filename -

setSyslogDest(...)

 
Causes log output to be written to the unix system log facility. syslog ident is set to 'libavg'.
Parameters:
  • facility - Passed to the system log verbatim. See man 3 syslog.
  • logopt - Passed to the system log verbatim. See man 3 syslog.

trace(...)

 
Logs message to the log if category is active.
Parameters:
  • category - One of the categories listed for setCategories(). Should in most cases be APP.
  • message - The log message.

Property Details

APP

Get Method:
unreachable(...)

BLTS

Get Method:
unreachable(...)

CONFIG

Get Method:
unreachable(...)

ERROR

Get Method:
unreachable(...)

EVENTS

Get Method:
unreachable(...)

EVENTS2

Get Method:
unreachable(...)

MEMORY

Get Method:
unreachable(...)

NONE

Get Method:
unreachable(...)

PROFILE

Get Method:
unreachable(...)

PROFILE_LATEFRAMES

Get Method:
unreachable(...)

WARNING

Get Method:
unreachable(...)