Skip to content

Commit

Permalink
make: add LOG_LEVEL to overridable variables
Browse files Browse the repository at this point in the history
  • Loading branch information
aabadie committed May 28, 2019
1 parent a66693d commit 166ed18
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,14 @@ ifeq ($(DEVELHELP),1)
CFLAGS += -DDEVELHELP
endif

# Override LOG_LEVEL if variable is set and if CFLAGS doesn't already contain
# a LOG_LEVEL config
ifdef LOG_LEVEL
ifneq (,$(filter -DLOG_LEVEL=%,$(CFLAGS)))
CFLAGS += -DLOG_LEVEL=$(LOG_LEVEL)
endif
endif

# Fail on warnings. Can be overridden by `make WERROR=0`.
WERROR ?= 1
export WERROR
Expand Down
2 changes: 2 additions & 0 deletions makefiles/vars.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,5 @@ export UNZIP_HERE # Use `cd $(SOME_FOLDER) && $(UNZIP_HERE) $(SOME_FI

export LAZYSPONGE # Command saving stdin to a file only on content update.
export LAZYSPONGE_FLAGS # Parameters supplied to LAZYSPONGE.

# LOG_LEVEL # Logging level as integer (NONE: 0, ERROR: 1, WARNING: 2, INFO: 3, DEBUG: 4, default: 3)

0 comments on commit 166ed18

Please sign in to comment.