Skip to main contentIBM Quantum Documentation
You are viewing the API reference for an old version of Qiskit SDK. Switch to latest version

qiskit.ignis.logging.IgnisLogging

class IgnisLogging(log_config_path=None)

GitHub(opens in a new tab)

Singleton class to configure file logging via IgnisLogger

Logging to file is enabled only if there is a config file present. Otherwise IgnisLogger will behave as a regular logger.

Config file is assumed to be in <user home>/.qiskit/logging.yaml

Config file fields:

file_logging: {true/false} - Specifies whether file logging is enabled

log_file: <path> - path to the log file. If not specified, ignis.log will be used

max_size: <# bytes> - maximum size limit for a given log file. If not specified file size is unlimited

max_rotations: <count> - maximum number of log files to rotate (oldest file is deleted in case count is reached)

__init__

__init__()

Initialize self. See help(type(self)) for accurate signature.


Methods

__init__()Initialize self.
default_datetime_fmt()Get the default date time format used for writing log entries
get_file_handler()Configure and retrieve the RotatingFileHandler object.
get_log_file()Get the name of the log file
get_logger(name)Return an IgnisLogger object

default_datetime_fmt

default_datetime_fmt()

Get the default date time format used for writing log entries

Return type

str

Returns

Default date time format

get_file_handler

get_file_handler()

Configure and retrieve the RotatingFileHandler object. Called on demand the first time IgnisLoggers needs to write to a file

Returns

The configured RotatingFileHandler object

Return type

RotatingFileHandler

get_log_file

get_log_file()

Get the name of the log file

Return type

str

Returns

Name of the log file

get_logger

get_logger(name)

Return an IgnisLogger object

To be used in by the code which needs logging.

Parameters

name (str) – Name of the module being logged

Return type

IgnisLogger

Returns

An IgnisLogger object

Was this page helpful?
Report a bug or request content on GitHub.