diff --git a/pydoc-markdown.yaml b/pydoc-markdown.yaml new file mode 100644 index 0000000000..122a7ff104 --- /dev/null +++ b/pydoc-markdown.yaml @@ -0,0 +1,22 @@ +loaders: + - type: python + search_path: [./src] +processors: + - type: filter + skip_empty_modules: true + exclude_private: true + document_only: false + - type: smart + - type: google + - type: crossref +renderer: + type: docusaurus + docs_base_path: docusaurus + relative_output_path: whylogs-api + relative_sidebar_path: sidebar.json + sidebar_top_level_label: 'Reference' + signature_in_header: true + markdown: + render_toc: true + escape_html_in_docstring: true + diff --git a/src/whylogs/app/logger.py b/src/whylogs/app/logger.py index 524accd7c4..672631ba7e 100644 --- a/src/whylogs/app/logger.py +++ b/src/whylogs/app/logger.py @@ -37,16 +37,14 @@ class Logger: :param session_timestamp: Optional. The time the session was created :param tags: Optional. Dictionary of key, value for aggregating data upstream :param metadata: Optional. Dictionary of key, value. Useful for debugging (associated with every single dataset profile) - :param writers: List of Writer objects used to write out the data - :param with_rotation_time. Whether to rotate with time, takes values of overall rotation interval, - "s" for seconds - "m" for minutes - "h" for hours - "d" for days - :param interval. Additinal time rotation multipler. - :param verbose: enable debug logging or not - :param cache_size: set how many dataprofiles to cache - :param segments: define either a list of egment keys or a list of segments tags: [ {"key":,"value": },... ] + :param writers: Optional. List of Writer objects used to write out the data + :param with_rotation_time: Optional. Combined with `interval` to create new output logs at regular intervals, \ + "s" for seconds, "m" for minutes, "h" for hours, "d" for days \ + Output filenames will have a suffix reflecting the rotation interval. + :param interval: Rotation interval multiplier, defaults to 1. + :param verbose: enable debug logging + :param cache_size: dataprofiles to cache + :param segments: define either a list of segment keys or a list of segments tags: [ {"key":,"value": },... ] :param profile_full_dataset: when segmenting dataset, an option to keep the full unsegmented profile of the dataset. :param constraints: static assertions to be applied to streams and summaries. """ @@ -168,19 +166,15 @@ def _set_rotation(self, with_rotation_time: str = None): if self.with_rotation_time == 's': interval = 1 # one second self.suffix = "%Y-%m-%d_%H-%M-%S" - self.extMatch = r"^\d{4}-\d{2}-\d{2}_\d{2}-\d{2}-\d{2}(\.\w+)?$" elif self.with_rotation_time == 'm': interval = 60 # one minute self.suffix = "%Y-%m-%d_%H-%M" - self.extMatch = r"^\d{4}-\d{2}-\d{2}_\d{2}-\d{2}(\.\w+)?$" elif self.with_rotation_time == 'h': interval = 60 * 60 # one hour self.suffix = "%Y-%m-%d_%H" - self.extMatch = r"^\d{4}-\d{2}-\d{2}_\d{2}(\.\w+)?$" elif self.with_rotation_time == 'd': interval = 60 * 60 * 24 # one day self.suffix = "%Y-%m-%d" - self.extMatch = r"^\d{4}-\d{2}-\d{2}(\.\w+)?$" else: raise TypeError("Invalid choice of rotation time, valid choices are {}".format( TIME_ROTATION_VALUES))