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
_instancesfield.- Parameters:
- name
str Name for the new logger
- mapdl_instance
ansys.mapdl.core.mapdl.MapdlBase Mapdl instance object. This should contain the attribute
name.
- name
- Returns:
ansys.mapdl.core.logging.PymapdlCustomAdapterLogger 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:
ExceptionYou can only input strings as
nameto this method.
- Return type: