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

Possibility to delete Backtrace Start and Backtrace End #2774

Closed
markusmu0 opened this issue Jun 23, 2023 · 5 comments
Closed

Possibility to delete Backtrace Start and Backtrace End #2774

markusmu0 opened this issue Jun 23, 2023 · 5 comments

Comments

@markusmu0
Copy link

Hi,
is there a possibility to delete Backtrace Start and End message?

If not: Is there another possibility to buffer/store some debug messages and only dump them, when a condition is true?

@tt4g
Copy link
Contributor

tt4g commented Jun 23, 2023

Duplicate #1623

Use ringbuffer_sink instead.

@markusmu0
Copy link
Author

Duplicate #1623

Use ringbuffer_sink instead.

I Don't think that this is a duplicate:
I am searching for a possibility

  1. to dump the output on a condition and not only if the buffer is full
  2. to throw away the logs if the condition is false
  3. to have a complete logger with multiple sinks with this behavior

Everything of this can be done with backtrace so the only problem is the start and end message

@tt4g
Copy link
Contributor

tt4g commented Jun 26, 2023

If compatibility is not broken, please submit PR.

@markusmu0
Copy link
Author

PR was rejected by gabime. Thus, the problem still exists. Is there another solution for this?

@tt4g
Copy link
Contributor

tt4g commented Jun 28, 2023

spdlog does not provide.

Both backtracer and ringbuffer_sink use spdlog::details::circular_q, so create a custom sink that buffers messages using spdlog::details::circular_q.

circular_q<log_msg_buffer> messages_;

details::circular_q<details::log_msg_buffer> q_;

Wiki: https://github.com/gabime/spdlog/wiki/4.-Sinks#implementing-your-own-sink

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.

3 participants