cement.core.log

Cement core log module.

class cement.core.log.LogHandler(**kw: Any)[source]

Bases: LogInterface, Handler

Log handler implementation.

class Meta[source]

Bases: Meta

class cement.core.log.LogInterface(**kw: Any)[source]

Bases: Interface

This class defines the Log Interface. Handlers that implement this interface must provide the methods and attributes defined below. In general, most implementations should sub-class from the provided LogHandler base class as a starting point.

class Meta[source]

Bases: Meta

Handler meta-data.

interface: str = 'log'

The string identifier of the interface.

abstract debug(msg: str) None[source]

Log to the DEBUG facility.

Parameters:

msg (str) – The message to log.

abstract error(msg: str) None[source]

Log to the ERROR facility.

Parameters:

msg (str) – The message to log.

abstract fatal(msg: str) None[source]

Log to the FATAL facility.

Parameters:

msg (str) – The message to log.

abstract get_level() str[source]

Return a string representation of the log level.

abstract info(msg: str) None[source]

Log to the INFO facility.

Parameters:

msg (str) – The message to log.

abstract set_level(level: str) None[source]
Set the log level. Must except atleast one of:

['INFO', 'WARNING', 'ERROR', 'DEBUG', or 'FATAL'].

abstract warning(msg: str) None[source]

Log to the WARNING facility.

Parameters:

msg (str) – The message to log.