LogInit: use StringIsEqual()
This commit is contained in:
parent
065926d6a4
commit
60bbc9f626
|
@ -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)
|
||||||
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)
|
||||||
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 {
|
||||||
|
|
Loading…
Reference in New Issue