quill
quill copied to clipboard
[FR] define custom format with callbacks.
It's commonly used that we will use some callbacks to set the format of the logger. For example:
- In some cases, we want to use the user passed timestamp rather than the system.
- we want to pass some globally defined information to the logger.
I understand that it would be useful to pass a custom timestamp for simulation purposes. It would be careful if you could provide an example of how you would like to call/use those callbacks
1 is now implemented on master. see example_custom_clock and example_custom_clock_advanced
We have one usecase. We capture timestamp in nanosecond at the start of the event and another at the end of the event. We log it after end of the event. We are calculating diff and parsing all timestamp before logging them. If we had a call back function then possibly we can calculate diff and parse timestamp in callback function in logger thread instead of main thread.