-
Notifications
You must be signed in to change notification settings - Fork 154
docs(logger): improve mkdocs and examples of sample rate feature #389
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
Conversation
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.
This is very clear now. Thanks!
// of being printed in a Lambda invocation | ||
logger.debug("This is a DEBUG log that has 50% chance of being printed"); | ||
logger.info("This is an INFO log that has 50% chance of being printed"); | ||
logger.warn("This is a WARN log that has 50% chance of being printed"); | ||
|
||
// Optional: refresh sample rate calculation on runtime |
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.
Just for my benefit, not trying to be annoying but only to understand myself.
Would this command reset the sample rate count, meaning that from here below all logs would have the original chance (set by sampleRateValue
)? What's an example in which I'd use this?
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.
meaning that from here below all logs would have the original chance (set by sampleRateValue)?
Almost! Not "from here below", but for all logs produced by that logger instance
What's an example in which I'd use this?
If I remember correctly this was a feature request by the community for the python tool, I need to find the conversation
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.
Just left a minor comment/question, but already good to go for me!
Description of your changes
The current version of the docs related to sample rate might be confusing and misleading, as they don't clarify the expected behaviour enough.
This PR includes some updates to mkdocs and examples of sample rate feature to clarify the feature and its behaviour.
How to verify this change
You can build and start a local docs website by running these two commands.
npm run docs-buildDockerImage
ORdocker build -t squidfunk/mkdocs-material ./docs/
npm run docs-runLocalDocker
ORdocker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material
Verify: http://0.0.0.0:8000/core/logger/#sampling-logs
Related issues, RFCs
#388
PR status
Is this ready for review?: YES
Is it a breaking change?: NO
Checklist
Breaking change checklist
N/A
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.