scripts: improve helpers/log.sh#2754
Merged
georglauterbach merged 4 commits intomasterfrom Sep 3, 2022
Merged
Conversation
This PR prepares for other PRs that use the newly introduced helper functions. The `_log` function itself was adjusted a bit to be shorter and more concise.
helpers/log.sh
polarathene
reviewed
Aug 31, 2022
polarathene
reviewed
Aug 31, 2022
polarathene
previously approved these changes
Aug 31, 2022
I implemented an alterative provided by @casperklein, which does the job as well without using string truncation syntax which can look ambiguous.
7 tasks
polarathene
approved these changes
Sep 1, 2022
| printf '%s' "${LOG_LEVEL}" | ||
| elif [[ -e /etc/dms-settings ]] | ||
| then | ||
| grep "^LOG_LEVEL=" /etc/dms-settings | cut -d "'" -f 2 |
Member
There was a problem hiding this comment.
Just a reminder that you added similar functionality in helpers/utils.sh. Might be good to apply the improvement there too:
docker-mailserver/target/scripts/helpers/utils.sh
Lines 15 to 22 in e6f481b
Member
Author
There was a problem hiding this comment.
Nice observation. I will provide a follow-up PR :)
casperklein
approved these changes
Sep 3, 2022
| then | ||
| grep "^LOG_LEVEL=" /etc/dms-settings | cut -d "'" -f 2 | ||
| else | ||
| printf 'info' |
Member
There was a problem hiding this comment.
🤷
Suggested change
| printf 'info' | |
| echo 'info' |
Member
Author
There was a problem hiding this comment.
Will do in a follow-up PR, so I can merge this first :)
| { | ||
| if [[ -n ${LOG_LEVEL+set} ]] | ||
| then | ||
| printf '%s' "${LOG_LEVEL}" |
Member
There was a problem hiding this comment.
Change it or leave it 😉
Suggested change
| printf '%s' "${LOG_LEVEL}" | |
| echo "${LOG_LEVEL}" |
Member
Author
There was a problem hiding this comment.
Will do in a follow-up PR, so I can merge this first :)
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This PR prepares for other PRs that use the newly introduced helper
functions. The
_logfunction itself was adjusted a bit to be shorterand more concise.
Follow up of #2752 taking care of
log.sh.Type of change
Checklist:
docs/)