Configuration#

class ansys.mechanical.core.embedding.logger.Configuration#

Configures logger for Mechanical embedding.

Overview#

configure

Configure the logger for PyMechanical embedding.

set_log_to_stdout

Configure logging to write to the standard output.

set_log_to_file

Configure logging to write to a file.

set_log_level

Set the log level for all configured sinks.

set_log_directory

Configure logging to write to a directory.

set_log_base_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:
levelint, optional

Level of logging that is defined in the logging package. The default is ‘DEBUG’. Options are "DEBUG", "INFO", "WARNING", and "ERROR".

directorystr, 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.

classmethod Configuration.set_log_to_stdout(value: bool) None#

Configure logging to write to the standard output.

classmethod Configuration.set_log_to_file(value: bool) None#

Configure logging to write to a file.

classmethod Configuration.set_log_level(level: int) None#

Set the log level for all configured sinks.

classmethod Configuration.set_log_directory(value: str) None#

Configure logging to write to a directory.

classmethod Configuration.set_log_base_directory(directory: str) None#

Configure logging to write in a time-stamped subfolder in this directory.