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

How to flush logs on every new line? #488

Closed
asaff1 opened this issue Jul 4, 2024 · 2 comments
Closed

How to flush logs on every new line? #488

asaff1 opened this issue Jul 4, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@asaff1
Copy link

asaff1 commented Jul 4, 2024

Is it possible to set the logs to always flush when a new line (similar to Python logging behavior)? print on every logging statement. Without manually calling flush each time.

Also when debugging, it takes some time the logs to appear, so it is good to have it enabled then, since cout and the logs are not ordered.

@odygrd
Copy link
Owner

odygrd commented Jul 11, 2024

it is not possible at the moment but i am adding it as a new feature for the next release.

Since i do not want to add another if statement on the hot path and that is meant to be mainly for debugging purposes i am adding it as a preprocessor flag that has to be defined QUILL_IMMEDIATE_FLUSH (ff4b208)

This means that to enable it you will have to recompile your project with the flag

@odygrd
Copy link
Owner

odygrd commented Jul 13, 2024

This is done in master branch, you can define QUILL_IMMEDIATE_FLUSH in the preprocessor to enable flushing on each log statement

@odygrd odygrd closed this as completed Jul 13, 2024
@odygrd odygrd added the enhancement New feature or request label Jul 13, 2024
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

2 participants