This commit is contained in:
gabime 2017-05-21 01:56:56 +03:00
parent 40fc5becff
commit 6cc7e7382e
7 changed files with 343 additions and 336 deletions

View File

@ -38,7 +38,10 @@ inline spdlog::logger::logger(const std::string& logger_name, sinks_init_list si
// ctor with single sink // ctor with single sink
inline spdlog::logger::logger(const std::string& logger_name, spdlog::sink_ptr single_sink): inline spdlog::logger::logger(const std::string& logger_name, spdlog::sink_ptr single_sink):
logger(logger_name, { single_sink }) logger(logger_name,
{
single_sink
})
{} {}

View File

@ -372,10 +372,12 @@ namespace spdlog
inline std::string errno_to_string(char buf[256], int res) inline std::string errno_to_string(char buf[256], int res)
{ {
if (res == 0) { if (res == 0)
{
return std::string(buf); return std::string(buf);
} }
else { else
{
return "Unknown error"; return "Unknown error";
} }
} }
@ -432,12 +434,14 @@ namespace spdlog
}; };
const char *env_p = std::getenv("TERM"); const char *env_p = std::getenv("TERM");
if (env_p == nullptr) { if (env_p == nullptr)
{
return false; return false;
} }
static const bool result = std::any_of( static const bool result = std::any_of(
std::begin(Terms), std::end(Terms), [&](const char* term) { std::begin(Terms), std::end(Terms), [&](const char* term)
{
return std::strstr(env_p, term) != nullptr; return std::strstr(env_p, term) != nullptr;
}); });
return result; return result;