Tip
Need help? Please let us know in the SUEWS Community.
Please report issues with the manual on GitHub Issues (or use Report Issue for This Page for page-specific feedback).
Please cite SUEWS with proper information from our Zenodo page.
6.2.3.1. supy.enable_file_logging#
- supy.enable_file_logging(path=None)[source]#
Write SuPy log messages to a file (opt-in).
- Parameters:
path (str or pathlib.Path, optional) – Target log file (a leading
~is expanded to the home directory), or an existing directory / a path with a trailing separator, in which aSuPy.logfile is written. Defaults toSuPy.login the current working directory. For a directory that may not exist yet, prefer theSUPY_LOG_DIRenvironment variable.- Returns:
The resolved log-file path. The file itself is not created until the first log record is emitted (
delay=True).- Return type:
Notes
Calling this again after file logging is already enabled is a no-op; the existing handler’s path is returned. Call
disable_file_logging()first to switch to a different file.