PyGeometryCustomAdapter
#
- class ansys.geometry.core.logger.PyGeometryCustomAdapter(logger, extra=None)#
Bases:
logging.LoggerAdapter
Keeps the reference to the Geometry service instance name dynamic.
If you use the standard approach, which is supplying extra input to the logger, you must input Geometry service instances each time you do a log.
Using adapters, you only need to specify the Geometry service instance that you are referring to once.
Overview#
Process the logging message and keyword arguments passed in to |
|
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.geometry.core.logger import PyGeometryCustomAdapter
Attribute detail#
- PyGeometryCustomAdapter.level = None#
- PyGeometryCustomAdapter.file_handler = None#
- PyGeometryCustomAdapter.stdout_handler = None#
- PyGeometryCustomAdapter.logger#
- PyGeometryCustomAdapter.std_out_handler#
Method detail#
- PyGeometryCustomAdapter.process(msg, kwargs)#
Process the logging message and keyword arguments passed in to a logging call to insert contextual information. You can either manipulate the message itself, the keyword args or both. Return the message and kwargs modified (or not) to suit your needs.
Normally, you’ll only need to override this one method in a LoggerAdapter subclass for your specific needs.
- PyGeometryCustomAdapter.log_to_file(filename: str = FILE_NAME, level: int = LOG_LEVEL)#
Add a file handler to the logger.