whylogs.api.logger.experimental.logger.actor.data_logger#

Module Contents#

Classes#

DataLogger

Interface for data loggers. This type has all of the methods that people would need for actually

Attributes#

whylogs.api.logger.experimental.logger.actor.data_logger.pd: Any#
whylogs.api.logger.experimental.logger.actor.data_logger.Row#
whylogs.api.logger.experimental.logger.actor.data_logger.TrackData#
whylogs.api.logger.experimental.logger.actor.data_logger.StatusType#
class whylogs.api.logger.experimental.logger.actor.data_logger.DataLogger#

Bases: Generic[StatusType]

Interface for data loggers. This type has all of the methods that people would need for actually logging data. Its potentially useful to use this as a return type instead of the process/thread logger since those have a lot more private methods that aren’t useful to the end user.

abstract status(timeout: Optional[float] = 1.0) StatusType#

Get diagnostic information about the state of the data logger

Parameters

timeout (Optional[float]) –

Return type

StatusType

abstract log(data: TrackData, timestamp_ms: Optional[int] = None, sync: bool = False) None#

Log some data.

Parameters
  • data (TrackData) – The data to log. This can either be a pandas data frame, a row (dictionary of str to str/int/float/etc), or a list of rows.

  • timestamp_ms (Optional[int]) – The timestamp of the data. If this isn’t supplied then it is assumed to have happened now.

  • sync (bool) – Whether or not to perform this action synchronously. By default, this is an asynchronous operation. You can make this synchronous in order to react to errors. Mostly useful when initially setting up logging since the only errors that can be responded to are data format related.

Return type

None

abstract flush() None#

Flush the internal state, causing everything to be written using the configured writers.

Return type

None

abstract close() None#

Close the logger, causing all resources to be released.

Return type

None