Skip to content

Caching formatted result from a log call #107

Answered by odygrd
jerome-trc asked this question in Q&A
Discussion options

You must be logged in to vote

Hello,

It is possible to implement custom handlers and register them.

Each logger can have multiple handlers attached.
And each handler can also have its own custom format.

If you would like a single LOG_ macro call to do all the 3 things listed above you have 2 options:

  1. Implement a custom handler that does all handing inside (file/vector/console).
  2. Use the existing console and file handlers and implement a custom handler to append to a vector.

I have pushed an example that is using option 2 here

Keep in mind that the vector in the example above is written by a backend worker thread. If you are having a different thread reading the vector to render it to the gui then you will have to use…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jerome-trc
Comment options

Answer selected by odygrd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants