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

log level none not supported by console sink #619

Closed
QuillUsr1 opened this issue Oct 30, 2024 · 2 comments · Fixed by #624
Closed

log level none not supported by console sink #619

QuillUsr1 opened this issue Oct 30, 2024 · 2 comments · Fixed by #624

Comments

@QuillUsr1
Copy link

QuillUsr1 commented Oct 30, 2024

Describe the bug
When using console sink with colours, logging using log_none fails.
fwrite failed errno: 14 error: Bad address
To Reproduce

  1. Create a console sink with colours
  2. log using loglevel::none : QUILL_LOGGER_CALL(QUILL_UNLIKELY, logger, nullptr, quill::LogLevel::None, fmt, ##__VA_ARGS__)

Expected Behaviour
I expect to see my log.
Instead I get:
fwrite failed errno: 14 error: Bad address.

Environment Details

  • Quill 7.2.1 (but from the source code, this is present in the latest release too)

Additional context
This problem can be solved by changing the size of the colours array to 11 (or 12 to include dynamic?).
std::array<std::string_view, 10> _colours; /**< Colours per log level */
and adding a default colour

@QuillUsr1 QuillUsr1 changed the title LOG None not supported log level none not supported by console sink Oct 30, 2024
@odygrd
Copy link
Owner

odygrd commented Oct 30, 2024

Hi! Thanks for reporting this. The purpose of LogLevel::None in the enum is to allow you to pass it to set_log_level() and disable all logging at runtime. It’s not intended to be logged as part of any log statement.

@odygrd odygrd linked a pull request Nov 2, 2024 that will close this issue
@odygrd
Copy link
Owner

odygrd commented Nov 2, 2024

I see it works after changing the array size

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