Closed houhuiting closed 1 year ago
rats-tls divides the workflow into initialization and running phases, see https://github.com/inclavare-containers/rats-tls/blob/master/docs/design/design.md#work-process for details. Register all instances in the initialization phase; select an instance in the running phase, and perform operations such as obtaining verification certificates.
During the initialization (registration) phase, use the environment variable RATS_TLS_GLOBAL_LOG_LEVEL to set the global log_level parameter global_log_level
(https://github.com/inclavare-containers/rats-tls/blob/master/src/core/main.c#L43) , such as running export RATS_TLS_GLOBAL_LOG_LEVEL = debug, you can see the log during the initialization (registration) phase.
In the running phase, the log_level obtained by the user through -l <log_level>
of rats-tls-server and rats-tls-client will override the global log_level parameter global_log_level
set in the initialization phase (https://github.com/inclavare-containers/rats-tls/blob/master/samples/rats-tls-server/server.c#L415). So, -l <log_level>
passed in by the user can only change the log type in the running phase.
Therefore, only using -l <log_level>
in rats-tls-server and rats-tls-client, it is expected that the log in the registration phase cannot be seen, which needs to be realized by configuring the environment variable RATS_TLS_GLOBAL_LOG_LEVEL.
Describe the bug
When the debug log option is entered in the simple program, only the logs in the APIs such as rats_tls_init() can be printed out, but the logs during registration cannot be printed out
If change RATS_TLS_LOG_LEVEL_DEFAULT in src/include/rats-tls/api.h to RATS_TLS_LOG_LEVEL_DEBUG, and can print out the log during registration.