PyAnsysHeartCustomAdapter
#
- class ansys.health.heart.logger.PyAnsysHeartCustomAdapter(logger: logging.Logger)#
Bases:
logging.LoggerAdapter
Keeps the reference to the PyAnsys Heart service instance dynamic.
If you use the standard approach, which is supplying extra input to the logger, you must input PyAnsys Heart service instances each time that you log a message.
Using adapters, you only need to specify the PyAnsys Heart service instance that you are referring to once.
Overview#
Process extra arguments. |
|
Add a file handler to the logger. |
|
Add a stdout handler to the logger. |
|
Change the log level of the object and the attached handlers. |
Import detail#
from ansys.health.heart.logger import PyAnsysHeartCustomAdapter
Attribute detail#
- PyAnsysHeartCustomAdapter.level = None#
- PyAnsysHeartCustomAdapter.file_handler: logging.FileHandler | None = None#
- PyAnsysHeartCustomAdapter.std_out_handler: logging.StreamHandler | None = None#
- PyAnsysHeartCustomAdapter.logger#
Method detail#
- PyAnsysHeartCustomAdapter.process(msg: str, kwargs: MutableMapping[str, Dict[str, str]])#
Process extra arguments.
- PyAnsysHeartCustomAdapter.log_to_file(filename: str = FILE_NAME, level: LOG_LEVEL_TYPE = LOG_LEVEL_FILE) None #
Add a file handler to the logger.