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

Support for async logging #44

Closed
gegles opened this issue Oct 3, 2019 · 5 comments · Fixed by #47
Closed

Support for async logging #44

gegles opened this issue Oct 3, 2019 · 5 comments · Fixed by #47

Comments

@gegles
Copy link
Contributor

gegles commented Oct 3, 2019

I've looked everywhere but can't seem to find how to enable async logging via spdlog_setup.

Am I missing something? Is this planned to be supported soon?

@guangie88
Copy link
Owner

Thanks for the feedback, it's not supported at the moment.

It seems like the way it's constructed is not too different from sync, so I might take a look when I'm free and try implementing it.

@gegles
Copy link
Contributor Author

gegles commented Oct 8, 2019

Thanks, that would be great! That's the one thing stopping from switching to spdlog_setup... I'll see if I find time to contribute a PR, but it would probably a lot faster for you to do it if you get to it.

@gegles
Copy link
Contributor Author

gegles commented Nov 1, 2019

Any hope of getting this soon? Just trying to plan for our release...

@guangie88
Copy link
Owner

Hey thanks for the wait, the support for async has arrived, the example for async looks something like this:

[global_thread_pool]
queue_size = 8192
num_threads = 1

[[thread_pool]]
name = "tp"
queue_size = 4096
num_threads = 2

# Uses global thread pool
[[logger]]
type = "async"
name = "global_async"
sinks = ["console_mt"]
pattern = "succient"

[[logger]]
type = "async"
name = "local_async"
sinks = ["console_mt"]
pattern = "succient"
thread_pool = "tp"
overflow_policy = "overrun_oldest"  # block (default) | overrun_oldest

Will be prepping this whole thing as a proper 0.3.0 release too.

@gegles
Copy link
Contributor Author

gegles commented Nov 2, 2019

Wow, now that was fast!!

Thank you so much! This looks perfect!

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

Successfully merging a pull request may close this issue.

2 participants