This repository was archived by the owner on Apr 4, 2024. It is now read-only.
Set Logger level using BORS_LOG_LEVEL if provided#1602
Merged
Conversation
Member
|
Have you tested this? I was under the impression that the Elixir logging package used macros to purge logging calls from the code entirely when the log level is lower than the one given. |
Contributor
Author
|
@notriddle We have tested this and it does work - we can even get a console into the running process using That purging only happens if |
Member
|
Okay, makes sense. bors r+ |
bors Bot
added a commit
that referenced
this pull request
Jan 13, 2023
1602: Set `Logger` level using `BORS_LOG_LEVEL` if provided r=notriddle a=jali-clarke Sometimes when the Github API is on the fritz it can be useful to have debug-level logging. Setting the log level in `config.exs` and rebuilding the container image is not ideal - having something more dynamic would be very nice to have. This PR introduces the `BORS_LOG_LEVEL` environment variable which is converted to a `Logger` level atom using `String.to_existing_atom` when provided. If `BORS_LOG_LEVEL` is unset, the `Logger` level will remain unchanged and is inherited from `config.exs` (i.e. `:info` for prod release). Co-authored-by: Jinnah Ali-Clarke <jinnah@noredink.com>
Contributor
|
Build failed: |
Contributor
Author
|
Fixing formatting issues... |
jali-clarke
force-pushed
the
set-log-level-via-env-var
branch
from
January 13, 2023 20:48
8a516f2 to
1ded233
Compare
Contributor
Author
|
@notriddle Amended and force-pushed. |
Member
|
bors r+ |
Contributor
|
Build succeeded: |
notriddle
added a commit
to bors-ng/bors-ng.github.io
that referenced
this pull request
Feb 1, 2023
Add @jali-clarke as new contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sometimes when the Github API is on the fritz it can be useful to have debug-level logging. Setting the log level in
config.exsand rebuilding the container image is not ideal - having something more dynamic would be very nice to have.This PR introduces the
BORS_LOG_LEVELenvironment variable which is converted to aLoggerlevel atom usingString.to_existing_atomwhen provided. IfBORS_LOG_LEVELis unset, theLoggerlevel will remain unchanged and is inherited fromconfig.exs(i.e.:infofor prod release).