whylogs.api.logger.rolling#

Module Contents#

Classes#

Scheduler

Multithreading scheduler.

TimedRollingLogger

A rolling logger that continuously rotates files based on time.

Attributes#

whylogs.api.logger.rolling.logger#
class whylogs.api.logger.rolling.Scheduler(initial: float, interval: float, function: Callable, *args: Any, **kwargs: Any)#

Bases: object

Multithreading scheduler.

Schedule a function to be called repeatedly based on a schedule.

Parameters
  • initial (float) –

  • interval (float) –

  • function (Callable) –

  • args (Any) –

  • kwargs (Any) –

start() None#
Return type

None

stop() None#
Return type

None

class whylogs.api.logger.rolling.TimedRollingLogger(schema: Optional[whylogs.core.DatasetSchema] = None, *, base_name: Optional[str] = None, file_extension: Optional[str] = None, interval: int = 1, when: typing_extensions.Literal[S, M, H, D] = 'H', utc: bool = False, aligned: bool = True, fork: bool = False, skip_empty: bool = False, callback: Optional[Callable[[whylogs.api.writer.Writer, whylogs.core.DatasetProfileView, str], None]] = None, metadata: Optional[Dict[str, str]] = None)#

Bases: whylogs.api.logger.logger.Logger

A rolling logger that continuously rotates files based on time.

Parameters
check_writer(writer: whylogs.api.writer.Writer) None#

Checks if a writer is configured correctly for this class

Parameters

writer (whylogs.api.writer.Writer) –

Return type

None

close() None#
Return type

None

append_writer(name: Optional[str] = None, *, writer: Optional[whylogs.api.writer.Writer] = None, **kwargs: Any) None#
Parameters
Return type

None

append_store(store: whylogs.api.store.ProfileStore) None#
Parameters

store (whylogs.api.store.ProfileStore) –

Return type

None

log(obj: Any = None, *, pandas: Optional[whylogs.core.stubs.pd.DataFrame] = None, row: Optional[Dict[str, Any]] = None, schema: Optional[whylogs.core.DatasetSchema] = None, timestamp_ms: Optional[int] = None, name: Optional[str] = None, trace_id: Optional[str] = None, tags: Optional[List[str]] = None, segment_key_values: Optional[Dict[str, str]] = None) whylogs.api.logger.result_set.ResultSet#
Parameters
  • timestamp_ms (Optional[int]) – The timestamp of the data being logged. This defaults to now if it isn’t provided. This is used to determine what the dataset timestamp should be. For an hourly model, the dataset timestamp will end up being the start of the hour of the provided timestamp_ms, UTC.

  • obj (Any) –

  • pandas (Optional[whylogs.core.stubs.pd.DataFrame]) –

  • row (Optional[Dict[str, Any]]) –

  • schema (Optional[whylogs.core.DatasetSchema]) –

  • name (Optional[str]) –

  • trace_id (Optional[str]) –

  • tags (Optional[List[str]]) –

  • segment_key_values (Optional[Dict[str, str]]) –

Return type

whylogs.api.logger.result_set.ResultSet