Skip to content

Add build options for logger verbosity#137

Closed
Momomentum wants to merge 1 commit intodavidmoreno:masterfrom
Momomentum:buildoptions-loglevel
Closed

Add build options for logger verbosity#137
Momomentum wants to merge 1 commit intodavidmoreno:masterfrom
Momomentum:buildoptions-loglevel

Conversation

@Momomentum
Copy link
Contributor

In one of my projects, the log gets quickly filled by debug messages. It would be great if there was a way to let the user configure the log level for app/library.

Here is a proposal for setting log level via cmake, but I could also imagine to set the level at runtime.

Lets the library consumer define the log level through a cmake cache
variable.
@aldipower
Copy link
Contributor

Oh nice! That's what I need too. rtpmidid is running 24/7 on my server trying to connect to my MioXL midi router, that is only powered some hours a day. This spams the syslog.

There is also an issue decribed #139

@davidmoreno What do you think?

@davidmoreno
Copy link
Owner

Hi,

Sorry for the time between updates, I've been busy, but found some time today.

I finally rewrote this part as I ddi not like messing with the template parameters. I did two options:

  • Compile time with a -DLOG_LEVEL=<1-4> so its even not compiled in, and should be a bit leaner (not much, but elides compilation of DEBUG, INFO and so on, so its something).
  • Runtime using --log-level=min_level or config log_level=min_level.

Options for level are debug, info, warning or error.

I think for you guys the most interesting would be the config file option.

Regards,
David.

@davidmoreno davidmoreno closed this Dec 6, 2025
@aldipower
Copy link
Contributor

Sound great. Thank you so much @davidmoreno

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 this pull request may close these issues.

3 participants