[Pal,LibOS] New logging system

Instead of 'loader.debug_type', introduce 'loader.log_level'
and 'loader.log_file', along with a set of definitions for
logging at a chosen level.

For now, the call sites keep using the legacy macros (SGX_DBG and
debug()), because converting them all will conflict with other
big changes in the code base. The existing LibOS calls are
assumed to be at 'info' level.
This commit is contained in:
Paweł Marczewski
2021-01-20 17:27:29 +01:00
committed by Michał Kowalczyk
parent e395e0133e
commit 17ab04db59
90 changed files with 412 additions and 238 deletions
+3 -3
View File
@@ -15,9 +15,9 @@ GRAPHENEDIR ?= ../..
SGX_SIGNER_KEY ?= $(GRAPHENEDIR)/Pal/src/host/Linux-SGX/signer/enclave-key.pem
ifeq ($(DEBUG),1)
GRAPHENEDEBUG = inline
GRAPHENE_LOG_LEVEL = debug
else
GRAPHENEDEBUG = none
GRAPHENE_LOG_LEVEL = error
endif
.PHONY: all
@@ -37,7 +37,7 @@ trusted-libs: ../common_tools/get_deps.sh
nodejs.manifest: nodejs.manifest.template trusted-libs
(sed -e 's|$$(GRAPHENEDIR)|'"$(GRAPHENEDIR)"'|g' \
-e 's|$$(GRAPHENEDEBUG)|'"$(GRAPHENEDEBUG)"'|g' \
-e 's|$$(GRAPHENE_LOG_LEVEL)|'"$(GRAPHENE_LOG_LEVEL)"'|g' \
-e 's|$$(NODEJS_DIR)|'"$(NODEJS_DIR)"'|g' \
-e 's|$$(ARCH_LIBDIR)|'"$(ARCH_LIBDIR)"'|g' \
$<; \
+2 -2
View File
@@ -8,8 +8,8 @@ libos.entrypoint = "file:$(NODEJS_DIR)/nodejs"
# so it is always set to libsysdb.so.
loader.preload = "file:$(GRAPHENEDIR)/Runtime/libsysdb.so"
# Show/hide debug log of Graphene ('inline' or 'none' respectively).
loader.debug_type = "$(GRAPHENEDEBUG)"
# Graphene log level
loader.log_level = "$(GRAPHENE_LOG_LEVEL)"
# Read application arguments directly from the command line. Don't use this on production!
loader.insecure__use_cmdline_argv = 1