diff --git a/include/opendht/log.h b/include/opendht/log.h index 442b28ee319fe2a779ec920fdfd4d3fb93180d17..92e11c63898e2f684f7cf4e7eba8c9e7a600c3cb 100644 --- a/include/opendht/log.h +++ b/include/opendht/log.h @@ -74,8 +74,5 @@ enableFileLogging(dht::DhtRunner &dht, const std::string &path); OPENDHT_PUBLIC void disableLogging(dht::DhtRunner &dht); - - } /* log */ } /* dht */ - diff --git a/src/log.cpp b/src/log.cpp index e9b70a7a272c52391fe316ac065c61bd1d44626a..b689e9fa86db78b0eaadee0870e758ac1b5c47df 100644 --- a/src/log.cpp +++ b/src/log.cpp @@ -27,7 +27,7 @@ namespace log { * Print va_list to std::ostream (used for logging). */ void -printLog(std::ostream &s, char const *m, va_list args) { +printLog(std::ostream& s, char const *m, va_list args) { // print log to buffer std::array<char, 8192> buffer; int ret = vsnprintf(buffer.data(), buffer.size(), m, args); @@ -52,17 +52,17 @@ printLog(std::ostream &s, char const *m, va_list args) { void enableLogging(dht::DhtRunner &dht) { dht.setLoggers( - [](char const *m, va_list args) { - std::cerr << red; - printLog(std::cerr, m, args); - std::cerr << def; - }, - [](char const *m, va_list args) { - std::cout << yellow; - printLog(std::cout, m, args); - std::cout << def; - }, - [](char const *m, va_list args) { printLog(std::cout, m, args); } + [](char const *m, va_list args) { + std::cerr << red; + printLog(std::cerr, m, args); + std::cerr << def; + }, + [](char const *m, va_list args) { + std::cout << yellow; + printLog(std::cout, m, args); + std::cout << def; + }, + [](char const *m, va_list args) { printLog(std::cout, m, args); } ); } @@ -72,9 +72,9 @@ enableFileLogging(dht::DhtRunner &dht, const std::string &path) { logfile->open(path, std::ios::out); dht.setLoggers( - [=](char const *m, va_list args) { printLog(*logfile, m, args); }, - [=](char const *m, va_list args) { printLog(*logfile, m, args); }, - [=](char const *m, va_list args) { printLog(*logfile, m, args); } + [=](char const *m, va_list args) { printLog(*logfile, m, args); }, + [=](char const *m, va_list args) { printLog(*logfile, m, args); }, + [=](char const *m, va_list args) { printLog(*logfile, m, args); } ); }