Skip to content

DLT logging property not used #27

@kkretsch

Description

@kkretsch

I tried to use DLT logging, but never got any lines until I changed the source.

In Logger.cpp is a line:

#ifdef USE_DLT
        if (useDlt_) {
            std::string app = Runtime::getProperty("LogApplication");

which always gets back an empty app object. The Runtime class only reads a predefined amount of values out of the commonapi.ini not including anything like LogApplication or LogContext.

And if I try to define those values in my client application like shown in some examples:

int main() {
std::cout << "Start of client main" << std::endl;
    CommonAPI::Runtime::setProperty("LogApplication", "CAPI");
    CommonAPI::Runtime::setProperty("LogContext", "SYNC");
std::cout << "End of setRuntime in client main" << std::endl;

I can see that the init function of the lib is executed before the very first lines of my own main function (what is the expected order, first init the base, then the top).

In init
prop LogApplication='
In register app
prop LogContext='
In register context
Start of client main
End of setRuntime in client main

All with the latest 3.2.0 tagged from this git.

Solution might be to add those two properties to the preloading steps of the Runtime class.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions