quill icon indicating copy to clipboard operation
quill copied to clipboard

[FR] define custom format with callbacks.

Open sjyMystery opened this issue 2 years ago • 3 comments

It's commonly used that we will use some callbacks to set the format of the logger. For example:

  1. In some cases, we want to use the user passed timestamp rather than the system.
  2. we want to pass some globally defined information to the logger.

sjyMystery avatar Aug 09 '21 05:08 sjyMystery

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

odygrd avatar Apr 15 '22 23:04 odygrd

1 is now implemented on master. see example_custom_clock and example_custom_clock_advanced

odygrd avatar Jul 08 '22 18:07 odygrd

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.

alphanso avatar Mar 30 '23 14:03 alphanso