这是indexloc提供的服务,不要输入任何密码
Skip to content

How to use trice to cover these example use cases? #531

Answered by rokath
jnz86 asked this question in Q&A
Discussion options

You must be logged in to vote

Is it possible to only include filename and line number for error-level logs?

The Trice tool shows the location information automatically using the information inside li.json. Transmitting the file names as runtime strings I would not recommend for performance reasons but you can try this in your code:

TRICE_ENTER_CRITICAL_SECTION triceS("err:%s", __FILE__); trice16("err::%d\n", __LINE__); TRICE_LEAVE_CRITICAL_SECTION

TRICE appears to lack traditional logging levels

What kind of syntax you expect? Please see the information about Trice format string tags inside the TriceUserManual. There is also a -logLevel CLI switch.

and doesn't offer a trice_with_fl(...) function that could condit…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by rokath
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested
2 participants