ansys.dyna.core.solver.dynalogging.PymapdlCustomAdapter#
- class ansys.dyna.core.solver.dynalogging.PymapdlCustomAdapter(logger, extra=None)#
Bases:
logging.LoggerAdapter
Adapter for keeping the reference to an MAPDL instance name dynamic.
Using the standard approach, extra parameters must be supplied to the logger to indicate the MAPDL instance for which messages must be logged.
With this class, you only have to specify the MAPDL instance that you are referring to once.
- level = None#
- file_handler = None#
- stdout_handler = None#
- logger#
- std_out_handler#
- 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.
- log_to_file(filename=FILE_NAME, level=LOG_LEVEL)#
Add a file handler to the logger.