You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
905 B
32 lines
905 B
4 months ago
|
# Compile time log levels
|
||
|
|
||
|
At compile time the maximum log level can be specified. This allows distros to
|
||
|
disable the overhead code and reduce overall code size.
|
||
|
|
||
|
# Runtime log level
|
||
|
|
||
|
At runtime, the log level is determined by an environment variable. The default
|
||
|
log level is WARNING. The level can be changed by setting the TSS2_LOG
|
||
|
environment variable.
|
||
|
|
||
|
Possible levels are: NONE, ERROR, WARNING, INFO, DEBUG, TRACE
|
||
|
|
||
|
The level can be set for all module using the `all` module name or individually
|
||
|
per module. The environment variable is evaluated left to right.
|
||
|
|
||
|
Example: `TSS2_LOG=all+ERROR,marshal+TRACE,tcti+DEBUG`
|
||
|
|
||
|
# Implementation
|
||
|
|
||
|
Each source code file specifies its corresponding module before including log.h.
|
||
|
```
|
||
|
#define LOGMODULE tcti
|
||
|
#include "log.h"
|
||
|
```
|
||
|
Optionally, the default log-level for this module can be set:
|
||
|
```
|
||
|
#define LOGMODULE tcti
|
||
|
#define LOGDEFAULT ERROR
|
||
|
#include "log.h"
|
||
|
```
|