@@ -387,14 +387,15 @@ environment variables are described:
387
387
388
388
### Initial Log level
389
389
390
- The default log level of DLT User library is DLT\_ LOG\_ INFO. This can be changed
390
+ The default log level of DLT User library is DLT\_ LOG\_ INFO (when using macro
391
+ DLT\_ REGISTER\_ CONTEXT or dlt\_ register\_ context() api). This can be changed
391
392
using a DLT client application (e.g. DLT Viewer). But there might be situations
392
- where DEBUG or VERBOSE messages are needed before the DLT Daemon updated the
393
- user library.
393
+ where DEBUG or VERBOSE messages are needed before the DLT Daemon updated the user library.
394
394
395
- In this case DLT\_ INITIAL\_ LOG\_ LEVEL can be exported. Using this environment
396
- variable, the user can specify log level for contexts that will be used on
397
- library startup.
395
+ There are several ways to initialize log level in DLT library startup phase.
396
+
397
+ 1 . It is possible to do that by exporting environment variable DLT\_ INITIAL\_ LOG\_ LEVEL.
398
+ By using this way, the user can specify log level for contexts.
398
399
399
400
For example, an application "EXA1" has two contexts "CON1" and "CON2". For
400
401
"CON1" log level DEBUG and for "CON2" log level VERBOSE shall be used. The
@@ -414,6 +415,31 @@ If the log level of context "CON1" shall be initialized, then:
414
415
415
416
> export DLT\_ INITIAL\_ LOG\_ LEVEL=":CON1:2"
416
417
418
+ In case only the log level of context "CON1" of application "EXA1" shall be
419
+ initialized, and other contexts will be ignored, then:
420
+
421
+ > export DLT\_ INITIAL\_ LOG\_ LEVEL="::0;EXA1:CON1:2"
422
+
423
+ 2 . If DLT\_ INITIAL\_ LOG\_ LEVEL variable is not exported in the environment,
424
+ log level for it each context can be changed in the config file (/etc/dlt.conf).
425
+
426
+ Default log level will be 4 (DLT\_ LOG\_ INFO)
427
+
428
+ > ContextLogLevel = 4
429
+
430
+ 3 . DLT user can use dlt\_ register\_ context\_ ll\_ ts() api to initialize log
431
+ level for each context.
432
+
433
+ Example:
434
+ > //Register new context to daemon, with initial log level is DLT\_ LOG\_ VERBOSE
435
+ >
436
+ > dlt\_ register\_ context\_ ll\_ ts(&con\_ exa1, "CON", "First context", DLT\_ LOG\_ VERBOSE, DLT\_ TRACE\_ STATUS\_ OFF);
437
+
438
+ The priority of context log level would be as follows:
439
+ - Priority 1: Using dlt\_ register\_ context\_ ll\_ ts() api
440
+ - Priority 2: Using environment variable DLT\_ INITIAL\_ LOG\_ LEVEL
441
+ - Priority 3: Setting in config file dlt.conf
442
+
417
443
### Local print mode
418
444
419
445
Sometimes it might be useful to print DLT messages for debugging directly to
0 commit comments