VizLogger#

class ansys.tools.visualization_interface.utils.logger.VizLogger(level: int = logging.ERROR, logger_name: str = 'VizLogger')#

Bases: object

Provides the singleton logger for the visualizer.

Parameters:
to_filebool, default: False

Whether to include the logs in a file.

Overview#

get_logger

Get the logger.

set_level

Set the logger output level.

enable_output

Enable logger output to a given stream.

add_file_handler

Save logs to a file in addition to printing them to the standard output.

Import detail#

from ansys.tools.visualization_interface.utils.logger import VizLogger

Method detail#

VizLogger.get_logger()#

Get the logger.

Returns:
Logger

Logger.

VizLogger.set_level(level: int)#

Set the logger output level.

Parameters:
levelint

Output Level of the logger.

VizLogger.enable_output(stream=None)#

Enable logger output to a given stream.

If a stream is not specified, sys.stderr is used.

Parameters:
stream: TextIO, default: ``sys.stderr``

Stream to output the log output to.

VizLogger.add_file_handler(logs_dir: str = './.log')#

Save logs to a file in addition to printing them to the standard output.

Parameters:
logs_dirstr, default: "./.log"

Directory of the logs.