Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to suppress messages from specific libraries? #76

Open
mbanders opened this issue Jul 18, 2017 · 4 comments
Open

Is there a way to suppress messages from specific libraries? #76

mbanders opened this issue Jul 18, 2017 · 4 comments

Comments

@mbanders
Copy link

Some libraries are excessively verbose with mbed trace messages. It slows down and frustrates developers/testers while they try to keep an eye out for the messages from the functions they actually care about.

Is there a way to supress messages from specific libraries or functions? Or is mbed trace an "all or nothing" type of thing? You get all messages, or none of them.

@ciarmcom
Copy link

ARM Internal Ref: IOTSYST-2492

@tommikas
Copy link

tommikas commented Jul 24, 2017

There isn't currently a compile time method for doing this. At runtime you can control which trace groups are visible with the exclude and include filters. Basically these work by scanning the defined filter string for the substring <trace group> for each mbed_tracef call.

Would that help at all?

@jupe jupe added the question label Apr 7, 2018
@jupe
Copy link
Contributor

jupe commented Apr 10, 2018

@kjbracey-arm do you have some good ideas how we could do compile time solution to disable/enable traces by individual group/file with minimal affects to existing API's and source codes, which also works seamless with all compilers and OS's we support.. ?

@kjbracey
Copy link
Contributor

I think you could do something if the groups could be specified as tokens - MyLb rather than "MyLb".

You would use the # operator to stringise these before passing to the formatter, and could use token pasting with ## to look for MBED_TRACE_GROUP_xxxx_ENABLE or DISABLE or something.

And then I guess a legacy fallback for what to do with existing "string" groups.

Final thought - as per Linux, you might want to treat "debug" distinctly - that has a "dynamic debug" feature which does this sort of per file/module/function filtering, but that is specific to "debug" level, which is the thing thought to be verbose enough to want the facility. Higher things are not filterable in that way. So maybe such compile-time switching (and maybe the runtime filtering) should/could be debug-specific, or optionally so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants