PelionIoT / mbed-trace

mbed trace library
Apache License 2.0
18 stars 15 forks source link

Feature request: Allow specifying component-specific max trace levels #59

Closed teetak01 closed 2 years ago

teetak01 commented 7 years ago

Something like this might be nice for trace-optimization.

You could choose what level of tracing you care from any component/group and anything extra is not compiled in code.

For ex. something like:

mbed_trace_max_trace_level(TEST, DEBUG); mbed_trace_max_trace_level(MAIN, WARN);

teetak01 commented 7 years ago

This could be also used to disable tracing from specific components.

ciarmcom commented 7 years ago

ARM Internal Ref: IOTSYST-1914

jupe commented 7 years ago

@tommikas do you have time for this?

jupe commented 7 years ago

compiling time or runtime ? runtime is quite easy but compiling time is more complicated...

teetak01 commented 7 years ago

We want it to be compile-time with the goal of saving flash from such components we don't care about.

We already have this (#53), but I think this will affect all the components?

teetak01 commented 7 years ago

But functionally, the application should have the capability to control tracing from all the dependencies as override.

tommikas commented 7 years ago

@tommikas do you have time for this?

Not really right now.

We already have this (#53), but I think this will affect all the components?

Yes, although that macro could be set in each source file just before including "mbed_trace.h" to set max level for specific files. You could do that conditionally based on self-defined macros to create groups.

the application should have the capability to control tracing from all the dependencies as override

This could be also done like that, but it'd require the component to have explicit support for it. Basically a component specific "enable traces" flag.