PyMechanicalCustomAdapter
#
- class ansys.mechanical.core.logging.PyMechanicalCustomAdapter(logger, extra=None)#
Bases:
logging.LoggerAdapter
Keeps the reference to the name of the Mechanical instance dynamic.
The standard approach supplies extra input to the logger. If this approach was used, Mechanical instances would have to be inputted every time a log is created.
Using an adapter means that the reference to the Mechanical instance must only be specified once.
Overview#
Process the message. |
|
Add a file handler to the logger. |
|
Add a standard output handler to the logger. |
|
Change the log level of the object and the attached handlers. |
Import detail#
from ansys.mechanical.core.logging import PyMechanicalCustomAdapter
Attribute detail#
- PyMechanicalCustomAdapter.level = None#
- PyMechanicalCustomAdapter.file_handler = None#
- PyMechanicalCustomAdapter.stdout_handler = None#
- PyMechanicalCustomAdapter.logger#
- PyMechanicalCustomAdapter.std_out_handler#
Method detail#
- PyMechanicalCustomAdapter.process(msg, kwargs)#
Process the message.
- PyMechanicalCustomAdapter.log_to_file(filename=FILE_NAME, level=LOG_LEVEL)#
Add a file handler to the logger.