dbdicom.Record.set_log#
- Record.set_log(filepath: str | None = None)[source]#
Set a new file for logging.
- Parameters:
filepath – full path to a log file. If not provided the current log file is removed. Alternatively the value ‘Default’ can be assigned, in which case a standard file at the same location of the database is automatically opened. Defaults to None.
- Raises:
FileNotFoundError – if the log file cannot be written to.
See also
Examples
Set a new log file:
>>> record.set_log('path/to/logfile')
and start logging:
>>> record.log('Starting new calculation...)
Alternatively, start a new log at the default location:
>>> record.set_log('Default')