aboutsummaryrefslogtreecommitdiff
path: root/engine.mk
diff options
context:
space:
mode:
authorArmelle Laine <armellel@google.com>2021-04-14 01:45:15 +0000
committerArmelle Laine <armellel@google.com>2021-04-20 22:20:11 +0000
commita0b8137af0aaadd8f5a0e89035a49ee0a214bacf (patch)
treed365f6db3dd846b62562739917b52ae8b2f6b944 /engine.mk
parent2fe0f040c00c745729db4f111cf2591d73fc6356 (diff)
downloadcommon-a0b8137af0aaadd8f5a0e89035a49ee0a214bacf.tar.gz
Add make variables to control kernel and user level logs
- the new LOG_LEVEL_USER variable is used to define TLOG_LVL_DEFAULT - rename LOGGING make variable to LOG_LEVEL_KERNEL to make its impact explicit Bug: 185911408 Change-Id: I89b3221f02f309ca855d45ad44b66fca648d9808
Diffstat (limited to 'engine.mk')
-rw-r--r--engine.mk15
1 files changed, 13 insertions, 2 deletions
diff --git a/engine.mk b/engine.mk
index 95d0a7b0..10ba5c2c 100644
--- a/engine.mk
+++ b/engine.mk
@@ -47,8 +47,18 @@ endif
endif
TEST_BUILD ?=
+
DEBUG ?= 2
-LOGGING ?= $(DEBUG)
+
+# LOG_LEVEL_KERNEL controls LK_LOGLEVEL
+# when LOG_LEVEL_KERNEL = 1, dprintf INFO level is enabled
+# when LOG_LEVEL_KERNEL = 2, dprintf SPEW level is enabled
+LOG_LEVEL_KERNEL ?= $(DEBUG)
+
+# LOG_LEVEL_USER controls TLOG_LVL_DEFAULT
+# when LOG_LEVEL_USER = 2 TLOG_LVL_DEFAULT = 4 (info)
+# when LOG_LEVEL_USER = 3 TLOG_LVL_DEFAULT = 5 (debug)
+LOG_LEVEL_USER ?= $(DEBUG)
BUILDDIR := $(BUILDROOT)/build-$(PROJECT)
OUTBIN := $(BUILDDIR)/lk.bin
@@ -221,7 +231,8 @@ GLOBAL_DEFINES += \
GLOBAL_DEFINES += \
LK_DEBUGLEVEL=$(DEBUG) \
- LK_LOGLEVEL=$(LOGGING) \
+ LK_LOGLEVEL=$(LOG_LEVEL_KERNEL) \
+ TLOG_LVL_DEFAULT=$$(($(LOG_LEVEL_USER)+2)) \
# test build?
ifneq ($(TEST_BUILD),)