107 lines
4.0 KiB
Plaintext
107 lines
4.0 KiB
Plaintext
---
|
||
title: IgnisLogging
|
||
description: API reference for qiskit.ignis.logging.IgnisLogging
|
||
in_page_toc_min_heading_level: 1
|
||
python_api_type: class
|
||
python_api_name: qiskit.ignis.logging.IgnisLogging
|
||
---
|
||
|
||
# qiskit.ignis.logging.IgnisLogging
|
||
|
||
<Class id="qiskit.ignis.logging.IgnisLogging" isDedicatedPage={true} github="https://github.com/qiskit-community/qiskit-ignis/tree/stable/0.6/qiskit/ignis/logging/ignis_logging.py" signature="IgnisLogging(log_config_path=None)" modifiers="class">
|
||
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\_\_
|
||
|
||
<Function id="qiskit.ignis.logging.IgnisLogging.__init__" signature="__init__()">
|
||
Initialize self. See help(type(self)) for accurate signature.
|
||
</Function>
|
||
|
||
## Methods
|
||
|
||
| | |
|
||
| -------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
|
||
| [`__init__`](#qiskit.ignis.logging.IgnisLogging.__init__ "qiskit.ignis.logging.IgnisLogging.__init__")() | Initialize self. |
|
||
| [`default_datetime_fmt`](#qiskit.ignis.logging.IgnisLogging.default_datetime_fmt "qiskit.ignis.logging.IgnisLogging.default_datetime_fmt")() | Get the default date time format used for writing log entries |
|
||
| [`get_file_handler`](#qiskit.ignis.logging.IgnisLogging.get_file_handler "qiskit.ignis.logging.IgnisLogging.get_file_handler")() | Configure and retrieve the RotatingFileHandler object. |
|
||
| [`get_log_file`](#qiskit.ignis.logging.IgnisLogging.get_log_file "qiskit.ignis.logging.IgnisLogging.get_log_file")() | Get the name of the log file |
|
||
| [`get_logger`](#qiskit.ignis.logging.IgnisLogging.get_logger "qiskit.ignis.logging.IgnisLogging.get_logger")(name) | Return an IgnisLogger object |
|
||
|
||
### default\_datetime\_fmt
|
||
|
||
<Function id="qiskit.ignis.logging.IgnisLogging.default_datetime_fmt" signature="default_datetime_fmt()">
|
||
Get the default date time format used for writing log entries
|
||
|
||
**Return type**
|
||
|
||
`str`
|
||
|
||
**Returns**
|
||
|
||
Default date time format
|
||
</Function>
|
||
|
||
### get\_file\_handler
|
||
|
||
<Function id="qiskit.ignis.logging.IgnisLogging.get_file_handler" signature="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
|
||
</Function>
|
||
|
||
### get\_log\_file
|
||
|
||
<Function id="qiskit.ignis.logging.IgnisLogging.get_log_file" signature="get_log_file()">
|
||
Get the name of the log file
|
||
|
||
**Return type**
|
||
|
||
`str`
|
||
|
||
**Returns**
|
||
|
||
Name of the log file
|
||
</Function>
|
||
|
||
### get\_logger
|
||
|
||
<Function id="qiskit.ignis.logging.IgnisLogging.get_logger" signature="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
|
||
</Function>
|
||
</Class>
|
||
|