msl.io.dataset_logging module

A Dataset that handles logging records.

class msl.io.dataset_logging.DatasetLogging(name, parent, level=0, attributes=None, logger=None, date_fmt=None, **kwargs)[source]

Bases: Dataset, Handler

A Dataset that handles logging records.

Do not instantiate directly. Create a new DatasetLogging using create_dataset_logging().

Parameters:
property attributes

The attribute names used by the DatasetLogging object.

Type:

tuple of str

property date_fmt

The datetime format code that is used to represent the asctime attribute in.

Type:

str

property logger

The Logger that this DatasetLogging object is added to.

Type:

Logger

remove_empty_rows()[source]

Remove empty rows from the Dataset.

If the DatasetLogging object was initialized with a shape or a size keyword argument then the size of the Dataset is always \(\geq\) to the number of logging records that were added to it. Calling this method will remove the rows in the Dataset that were not from a logging record.

remove_handler()[source]

Remove this class’s Handler from the associated Logger.

After calling this method logging records are no longer added to the Dataset.

set_logger(logger)[source]

Add this class’s Handler to a Logger.

Parameters:

logger (Logger) – The Logger to add this class’s Handler to.