Nitrokey / libnitrokey

Communicate with Nitrokey devices in a clean and easy manner
https://nitrokey.com/
GNU Lesser General Public License v3.0
65 stars 34 forks source link

Allow custom loggers #202

Closed robinkrahl closed 3 years ago

robinkrahl commented 3 years ago

Currently, libnitrokey prints all log messages to stderr/std::clog. It would be useful to be able to specify a custom logging function instead to allow applications to use their own logging mechanisms.

As far as I see, there already is a NitrokeyManager::set_log_function method. This function could be added to the C API and adapated to accept the log level and the raw log message instead of the fully formatted log message.

robinkrahl commented 3 years ago

This would allow us to integrate the libnitrokey log messages with our own log messages in nitrocli, see https://github.com/d-e-s-o/nitrocli/issues/177.