add_instance_logger#

Logger.add_instance_logger(name, mapdl_instance, level=None)#

Create a logger for a MAPDL instance.

The MAPDL instance logger is a logger with an adapter which add the contextual information such as MAPDL instance name. This logger is returned and you can use it to log events as a normal logger. It is also stored in the _instances field.

Parameters:
namestr

Name for the new logger

mapdl_instanceansys.mapdl.core.mapdl.MapdlBase

Mapdl instance object. This should contain the attribute name.

Returns:
ansys.mapdl.core.logging.PymapdlCustomAdapter

Logger adapter customized to add MAPDL information to the logs. You can use this class to log events in the same way you would with the logger class.

Raises:
Exception

You can only input strings as name to this method.

Return type:

Logger