Configuration
#
- class ansys.mechanical.core.embedding.logger.Configuration#
Configures logger for Mechanical embedding.
Overview#
Configure the logger for PyMechanical embedding. |
|
Configure logging to write to the standard output. |
|
Configure logging to write to a file. |
|
Set the log level for all configured sinks. |
|
Configure logging to write to a directory. |
|
Configure logging to write in a time-stamped subfolder in this directory. |
Import detail#
from ansys.mechanical.core.embedding.logger import Configuration
Method detail#
- classmethod Configuration.configure(level=logging.WARNING, directory=None, base_directory=None, to_stdout=True)#
Configure the logger for PyMechanical embedding.
- Parameters:
- level
int
,optional
Level of logging that is defined in the
logging
package. The default is ‘DEBUG’. Options are"DEBUG"
,"INFO"
,"WARNING"
, and"ERROR"
.- directory
str
,optional
Directory to write log file to. The default is
None
, but by default the log will appear somewhere in the system temp folder.- base_directory: str, optional
Base directory to write log files to. Each instance of Mechanical will write its log to a time-stamped subfolder within this directory. This is only possible to set before Mechanical is initialized.
- to_stdoutbool,
optional
Whether to write log messages to the standard output, which is the command line. The default is
True
.
- level
- classmethod Configuration.set_log_to_stdout(value: bool) None #
Configure logging to write to the standard output.
- classmethod Configuration.set_log_level(level: int) None #
Set the log level for all configured sinks.