Skip to content

Commit

Permalink
fix typos in logger doc strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Warth committed Mar 25, 2021
1 parent b304e96 commit beb9b96
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 14 deletions.
22 changes: 22 additions & 0 deletions pydoc-markdown.yaml
Original file line number Diff line number Diff line change
@@ -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

22 changes: 8 additions & 14 deletions src/whylogs/app/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":<featurename>,"value": <featurevalue>},... ]
: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":<featurename>,"value": <featurevalue>},... ]
: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.
"""
Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit beb9b96

Please sign in to comment.