dbdicom.Record.log#

Record.log(message: str)[source]#

Write an entry in the log file.

If no logfile is set, this function only writes a message in the terminal.

Parameters:

message (str) – text message to be written in the log file. The function automatically includes some timing information so this does not need to be included in the message.

Raises:

FileNotFoundError – if the log file cannot be written to.

See also

set_log

Examples

Set a default file for logging and write a first message:

>>> record.set_log('Default')
>>> record.log('Starting new calculation...)