Skip to content

Logger implementation#3

Open
zkscpqm wants to merge 1 commit intomasterfrom
logging_implementation
Open

Logger implementation#3
zkscpqm wants to merge 1 commit intomasterfrom
logging_implementation

Conversation

@zkscpqm
Copy link
Copy Markdown
Owner

@zkscpqm zkscpqm commented Sep 6, 2021

Todo:

  • Text logger
  • JSON logger
  • Exporter sub_handler to send serialized logs somewhere
  • Log rotator

Later Todo if there is time:

  • Logger output buffer which gets flushed periodically by dedicated worker thread

@zkscpqm zkscpqm added WIP Work in Progress enhancement New feature or request Logging Any PRs related to logging functionality labels Sep 6, 2021
fields: dict_type[str, Any]

def __init__(self, message: str, timestamp: _dt, severity: Severity = LogLevels.INFO,
fields: dict_type[str, Any] = None, message_format_mapping: dict_type[str, Any] = None):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Return type?

handler.handle_message(message=message_, **handler_kwargs)

def debug(self, message: str = '', fields: dict_type[str, Any] = None,
message_format_mapping: dict_type[str, Any] = None, **handler_kwargs):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type of the return?

)

def info(self, message: str = '', fields: dict_type[str, Any] = None,
message_format_mapping: dict_type[str, Any] = None, **handler_kwargs):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type return of the?

def __gt__(self, other: 'Severity'):
return self.level > other.level

def __ge__(self, other: 'Severity'):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bool rv.

Comment thread macros/string_macros.py
return str_[:index], str_[index:]


def multiple_replace(input_string: str, kwargs_dict: dict[str: Any]):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re needs a re-turn. Ba-dum ts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Logging Any PRs related to logging functionality WIP Work in Progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants