make: add LOG_LEVEL to overridable variables#11592
Merged
aabadie merged 1 commit intoRIOT-OS:masterfrom May 29, 2019
Merged
Conversation
miri64
requested changes
May 28, 2019
makefiles/vars.inc.mk
Outdated
| export LAZYSPONGE # Command saving stdin to a file only on content update. | ||
| export LAZYSPONGE_FLAGS # Parameters supplied to LAZYSPONGE. | ||
|
|
||
| # LOG_LEVEL # Logging level (NONE: 0, ERROR: 1, WARNING: 2, INFO: 3, DEBUG: 4, default: 3) |
Member
There was a problem hiding this comment.
This might be ambiguous. This could be read, that log levels are to be given as words. Maybe write
Suggested change
| # LOG_LEVEL # Logging level (NONE: 0, ERROR: 1, WARNING: 2, INFO: 3, DEBUG: 4, default: 3) | |
| # LOG_LEVEL # Logging level as integer (NONE: 0, ERROR: 1, WARNING: 2, INFO: 3, DEBUG: 4, default: 3) |
Makefile.include
Outdated
| endif | ||
|
|
||
| # If not already set in CFLAGS, set logging level by default to INFO, e.g. 3. | ||
| LOG_LEVEL ?= 3 |
Member
There was a problem hiding this comment.
Why not leave it unset and check if it is set as default? This way in case we want to change the default we don't have to do it in three places (here, the doc in vars.inc.mk, and the define) and confusions for a person trying to change just the define are avoided.
Contributor
Author
There was a problem hiding this comment.
Ok, I changed it this way.
ebb3a4f to
cfc19bf
Compare
miri64
requested changes
May 28, 2019
be4f265 to
52d774a
Compare
miri64
approved these changes
May 28, 2019
52d774a to
166ed18
Compare
Contributor
Author
|
All green, let's go! |
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.
Contribution description
This PR allows to set the logging level via a make variable instead of having to explicitly set this via CFLAGS. Example:
With this PR, one can use
LOG_LEVEL=4 make -C <application dir>to enable debug log level instead of CFLAGS=-DLOG_LEVEL=4 make -CIf an application already set the log level via CFLAGS, then this variable is ignored.
Testing procedure
One can try to disable logging by using LOG_LEVEL=0 in any application an notice that the
This is RIOT!welcome message is not displayed at any application startup.Issues/PRs references
Idea raised by @miri64 in #11573 (see #11573 (comment))