diff options
Diffstat (limited to 'NitrokeyManager.cc')
-rw-r--r-- | NitrokeyManager.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc index a4ce3a5..3af74ea 100644 --- a/NitrokeyManager.cc +++ b/NitrokeyManager.cc @@ -8,7 +8,7 @@ #include "include/misc.h" #include <mutex> #include "include/cxx_semantics.h" - +#include <functional> namespace nitrokey{ @@ -95,6 +95,12 @@ namespace nitrokey{ return device != nullptr; } + + void NitrokeyManager::set_log_function(std::function<void(std::string)> log_function){ + static nitrokey::log::FunctionalLogHandler handler(log_function); + nitrokey::log::Log::instance().set_handler(&handler); + } + bool NitrokeyManager::set_default_commands_delay(int delay){ if (delay < 20){ LOG("Delay set too low: " + to_string(delay), Loglevel::WARNING); |