Logger
#
- class ansys.additive.core.logger.Logger(level=logging.DEBUG, to_file=False, to_stdout=True, filename=FILE_NAME)#
Provides the logger used for each PyAdditive session.
This class allows you to add handlers to the logger to output messages to a file or to the standard output (stdout).
- Parameters:
- level
default
DEBUG
Logging level to filter the message severity allowed in the logger.
- to_filebool, default:
False
Whether to write log messages to a file.
- to_stdoutbool, default:
True
Whether to write log messages to the standard output.
- filenamestr, default: obj:FILE_NAME
Name of the file to write log log messages to.
- level
Overview#
Add a file handler to the logger. |
|
Add the standard output handler to the logger. |
|
Redirect the output of an exception to a logger. |
|
Set the logging level for the logger. |
Import detail#
from ansys.additive.core.logger import Logger
Attribute detail#
- Logger.file_handler = None#
- Logger.stdout_handler = None#
- Logger.logger#
- Logger.debug#
- Logger.info#
- Logger.warning#
- Logger.error#
- Logger.critical#
- Logger.log#
Method detail#
- Logger.log_to_file(filename=FILE_NAME, level=LOG_LEVEL)#
Add a file handler to the logger.
- Parameters:
- filenamestr, default: obj:FILE_NAME
Name of the file to write log messages to.
- level
default
DEBUG
Logging level to filter the message severity allowed in the logger.
- Logger.log_to_stdout(level=LOG_LEVEL)#
Add the standard output handler to the logger.
- Parameters:
- level
default
DEBUG
Logging level to filter the message severity allowed in the logger.
- level
- Logger.add_handling_uncaught_expections(logger)#
Redirect the output of an exception to a logger.
- Parameters:
- logger
str
Name of the logger.
- logger