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

Are there plans to implement crash safe feature like g3log? #1

Closed
ngugcx opened this issue Mar 9, 2020 · 2 comments · Fixed by #77
Closed

Are there plans to implement crash safe feature like g3log? #1

ngugcx opened this issue Mar 9, 2020 · 2 comments · Fixed by #77
Labels
enhancement New feature or request

Comments

@ngugcx
Copy link

ngugcx commented Mar 9, 2020

Awesome lib!
Are there plans to implement crash safe feature like g3log?
This is the only reason why I choose g3log other than other tools.

@odygrd
Copy link
Owner

odygrd commented Mar 23, 2020

Hello, thanks and sorry for the slow response

The reason it is not implemented is because it would restrict how the user application could handle signals.

Therefore, I don't think this should be supported by the logging library but instead it should be up to the application developer to decide how he would handle signals. If it would be a feature for sure it would be optional.

In addition handling signals in multithread applications can be a bit tricky. While it is straight forward to redirect signals to a specific thread when you send them from e.g. via the terminal, if the signals are generated by the threads themselves (e.g a SIGEVG) they won't be handled by the specified thread.

For a similar implementation to g3log you can setup your own signal handler in your application and use this on linux, remove lines 71-81 and instead call quill::flush() or similarly on windows

quill::flush() will block the current thread until all log from all threads is flushed to the file

@odygrd odygrd added the enhancement New feature or request label Mar 23, 2020
@odygrd odygrd linked a pull request Nov 15, 2020 that will close this issue
@odygrd
Copy link
Owner

odygrd commented Nov 21, 2020

There is a crash safe feature now in quill. See https://github.com/odygrd/quill/blob/master/examples/example_signal_handler.cpp for more details

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

Successfully merging a pull request may close this issue.

2 participants