skidl.logger module

Logging for generic messages and ERC.

class skidl.logger.ActiveLogger(logger)[source]

Bases: skidl.logger.SkidlLogger

Currently-active logger for a given phase of operations.

pop()[source]

Re-activate the previously active logger.

push(logger)[source]

Save the currently active logger and activate the given logger.

Parameters

logger (SkidlLogger) – Logger to be activated.

set(logger)[source]

Set the active logger.

Parameters

logger (SkidlLogger) – Logger that will be used for current phase of operations.

class skidl.logger.CountCalls(func)[source]

Bases: object

Decorator for counting the number of times a function is called.

This is used for counting errors and warnings passed to logging functions, making it easy to track if and how many errors/warnings were issued.

reset()[source]
class skidl.logger.SkidlLogFileHandler(*args, **kwargs)[source]

Bases: logging.FileHandler

Logger that outputs messages to a file.

remove_log_file()[source]
class skidl.logger.SkidlLogger(*args, **kwargs)[source]

Bases: logging.Logger

SKiDL logger that can stop output to log files and delete them.

addHandler(handler)[source]

Add the specified handler to this logger.

critical(msg, *args, **kwargs)[source]

Log ‘msg % args’ with severity ‘CRITICAL’.

To pass exception information, use the keyword argument exc_info with a true value, e.g.

logger.critical(“Houston, we have a %s”, “major disaster”, exc_info=1)

debug(msg, *args, **kwargs)[source]

Log ‘msg % args’ with severity ‘DEBUG’.

To pass exception information, use the keyword argument exc_info with a true value, e.g.

logger.debug(“Houston, we have a %s”, “thorny problem”, exc_info=1)

error(msg, *args, **kwargs)[source]

Log ‘msg % args’ with severity ‘ERROR’.

To pass exception information, use the keyword argument exc_info with a true value, e.g.

logger.error(“Houston, we have a %s”, “major problem”, exc_info=1)

get_trace()[source]
info(msg, *args, **kwargs)[source]

Log ‘msg % args’ with severity ‘INFO’.

To pass exception information, use the keyword argument exc_info with a true value, e.g.

logger.info(“Houston, we have a %s”, “interesting problem”, exc_info=1)

raise_(exc_class, msg)[source]

Issue a logging message and then raise an exception.

Parameters
  • exc_class (Exception class) – Class of exception to raise.

  • msg (string) – Error message.

Raises

exc_class – Exception class that is raised after error message is logged.

removeHandler(handler)[source]

Remove the specified handler from this logger.

report_summary(phase_desc)[source]

Report total of logged errors and warnings.

Parameters

phase_desc (string) – description of the phase of operations (e.g. “generating netlist”).

set_trace_depth(depth)[source]
stop_file_output()[source]

Stop file outputs for all log handlers of this logger.

warning(msg, *args, **kwargs)[source]

Log ‘msg % args’ with severity ‘WARNING’.

To pass exception information, use the keyword argument exc_info with a true value, e.g.

logger.warning(“Houston, we have a %s”, “bit of a problem”, exc_info=1)

skidl.logger.stop_log_file_output()[source]

Stop loggers from creating files containing log messages.