Commit 60bbc9f6 authored by Max Kellermann's avatar Max Kellermann

LogInit: use StringIsEqual()

parent 065926d6
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "fs/FileSystem.hxx" #include "fs/FileSystem.hxx"
#include "util/Domain.hxx" #include "util/Domain.hxx"
#include "util/RuntimeError.hxx" #include "util/RuntimeError.hxx"
#include "util/StringAPI.hxx"
#include "system/Error.hxx" #include "system/Error.hxx"
#include <cassert> #include <cassert>
...@@ -96,11 +97,11 @@ log_init_file(int line) ...@@ -96,11 +97,11 @@ log_init_file(int line)
static inline LogLevel static inline LogLevel
parse_log_level(const char *value) parse_log_level(const char *value)
{ {
if (0 == strcmp(value, "default")) if (StringIsEqual(value, "default"))
return LogLevel::DEFAULT; return LogLevel::DEFAULT;
if (0 == strcmp(value, "secure")) if (StringIsEqual(value, "secure"))
return LOG_LEVEL_SECURE; return LOG_LEVEL_SECURE;
else if (0 == strcmp(value, "verbose")) else if (StringIsEqual(value, "verbose"))
return LogLevel::DEBUG; return LogLevel::DEBUG;
else else
throw FormatRuntimeError("unknown log level \"%s\"", value); throw FormatRuntimeError("unknown log level \"%s\"", value);
...@@ -160,7 +161,7 @@ log_init(const ConfigData &config, bool verbose, bool use_stdout) ...@@ -160,7 +161,7 @@ log_init(const ConfigData &config, bool verbose, bool use_stdout)
throw std::runtime_error("config parameter 'log_file' not found"); throw std::runtime_error("config parameter 'log_file' not found");
#endif #endif
#ifdef HAVE_SYSLOG #ifdef HAVE_SYSLOG
} else if (strcmp(param->value.c_str(), "syslog") == 0) { } else if (StringIsEqual(param->value.c_str(), "syslog")) {
LogInitSysLog(); LogInitSysLog();
#endif #endif
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment