dynsight.logs.Logger

class dynsight.logs.Logger(*, auto_recording=False)[source]

Create and save human-readible log.

Methods

clear_history

Clears the current log history and registered datasets.

configure

Adjusts the runtime configuration of the logger.

extract_datasets

Exports all recorded datasets into a ZIP archive.

get

Retrieves the current log history as a string.

log

Records an informational message to the log.

record_data

Record and save a dataset associated with an Insight instance.

save_history

Saves the current log history to a text file.

warning

Records an informational warning message to the log.

Parameters:

auto_recording (bool)

clear_history()[source]

Clears the current log history and registered datasets.

Return type:

None

configure(*, auto_recording=False)[source]

Adjusts the runtime configuration of the logger.

Parameters:

auto_recording (bool) – Enables or disables automatic dataset recording. When set to True, every processed dataset will be automatically saved into a temporary archive. When False, datasets must be explicitly registered via register_data().

Return type:

None

extract_datasets(output_dir=PosixPath('analysis_archive'))[source]

Exports all recorded datasets into a ZIP archive.

Parameters:

output_dir (Path | str) – The directory where the ZIP archive will be saved.

Return type:

None

get()[source]

Retrieves the current log history as a string.

Return type:

str

log(msg)[source]

Records an informational message to the log.

Parameters:

msg (str) – The message to record.

Return type:

None

record_data(insight)[source]

Record and save a dataset associated with an Insight instance.

Parameters:

insight (Insight) – the Insight to be registered.

Return type:

None

save_history(filename)[source]

Saves the current log history to a text file.

Parameters:

filename (Path) – The file path where the log history will be written.

Return type:

None

warning(msg)[source]

Records an informational warning message to the log.

Parameters:

msg (str) – The message to record.

Return type:

None