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

[FR] define custom format with callbacks. #124

Open
sjyMystery opened this issue Aug 9, 2021 · 3 comments
Open

[FR] define custom format with callbacks. #124

sjyMystery opened this issue Aug 9, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@sjyMystery
Copy link

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.
@odygrd odygrd added the enhancement New feature or request label Apr 10, 2022
@odygrd
Copy link
Owner

odygrd commented Apr 15, 2022

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
Copy link
Owner

odygrd commented Jul 8, 2022

1 is now implemented on master.
see example_custom_clock and example_custom_clock_advanced

@alphanso
Copy link

alphanso commented Mar 30, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants