whylogs.api.logger.rolling
#
Module Contents#
Classes#
Multithreading scheduler. |
|
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.
- 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
schema (Optional[whylogs.core.DatasetSchema]) –
base_name (Optional[str]) –
file_extension (Optional[str]) –
interval (int) –
when (typing_extensions.Literal[S, M, H, D]) –
utc (bool) –
aligned (bool) –
fork (bool) –
skip_empty (bool) –
callback (Optional[Callable[[whylogs.api.writer.Writer, whylogs.core.DatasetProfileView, str], None]]) –
- 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
- append_writer(name: Optional[str] = None, *, writer: Optional[whylogs.api.writer.Writer] = None, **kwargs: Any) None #
- Parameters
name (Optional[str]) –
writer (Optional[whylogs.api.writer.Writer]) –
kwargs (Any) –
- Return type
- append_store(store: whylogs.api.store.ProfileStore) None #
- Parameters
store (whylogs.api.store.ProfileStore) –
- Return type
- 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]]) –
- Return type