-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: implement support for structured logging #7126
Conversation
haystack/logging.py
Outdated
# https://www.structlog.org/en/stable/standard-library.html#rendering-using-structlog-based-formatters-within-logging | ||
# This means that we use structlog to format the log entries for entries emitted via `logging` and `structlog`. | ||
|
||
shared_processors = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will add trace / log correlation in a separate PR
haystack_logging.configure_logging() | ||
|
||
logger = logging.getLogger(__name__) | ||
logger.warning("Hello, structured logging!", extra={"key1": "value1", "key2": "value2"}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will add a new logger class to ease logging extras
in a separate PR
c5909b5
to
976f375
Compare
Pull Request Test Coverage Report for Build 8052623938Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 8050998893Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Related Issues
Proposed Changes:
How did you test it?
Notes for the reviewer
Checklist
fix:
,feat:
,build:
,chore:
,ci:
,docs:
,style:
,refactor:
,perf:
,test:
.