Logger#

Logger/library versions#

This functions provides utility functions for logging simulation information and system details using Python’s logging module. It also logs versions of important libraries such as Python, DolfinX, ufl, basix, numpy, and logging, along with system information like platform details and Python version.

phasefieldx.Logger.library_versions.log_end_analysis(logger, totaltime=0.0)[source]#
phasefieldx.Logger.library_versions.log_library_versions(logger)[source]#

Log versions of important libraries.

Parameters:
loggerlogging.Logger

The logger object to log the information.

Returns:
None

Notes

This function logs the versions of important libraries including Python, DolfinX, ufl, basix, numpy, and logging.

phasefieldx.Logger.library_versions.log_model_information(msh, logger)[source]#
phasefieldx.Logger.library_versions.log_system_info(logger)[source]#

Log system information using the provided logger.

Parameters:
loggerlogging.Logger

The logger object to be used for logging system information.

Returns:
None

Notes

This function logs various system information including operating system, architecture, user name, processor, machine type, and Python version.

phasefieldx.Logger.library_versions.set_logger(result_folder_name)[source]#

Set up a logger for logging simulation information.

Parameters:
result_folder_namestr

The name of the folder where the log file will be stored.

Returns:
logging.Logger

The logger object set up for logging simulation information.

Notes

This function sets up a logger named ‘simulation_logger’ with INFO level logging. It creates a log file named ‘simulation.log’ in the specified result folder.

Examples

>>> logger = set_logger('results_folder')