LogInit: use StringIsEqual()

This commit is contained in:
Max Kellermann 2020-09-23 13:25:26 +02:00
parent 065926d6a4
commit 60bbc9f626
1 changed files with 5 additions and 4 deletions

View File

@ -28,6 +28,7 @@
#include "fs/FileSystem.hxx"
#include "util/Domain.hxx"
#include "util/RuntimeError.hxx"
#include "util/StringAPI.hxx"
#include "system/Error.hxx"
#include <cassert>
@ -96,11 +97,11 @@ log_init_file(int line)
static inline LogLevel
parse_log_level(const char *value)
{
if (0 == strcmp(value, "default"))
if (StringIsEqual(value, "default"))
return LogLevel::DEFAULT;
if (0 == strcmp(value, "secure"))
if (StringIsEqual(value, "secure"))
return LOG_LEVEL_SECURE;
else if (0 == strcmp(value, "verbose"))
else if (StringIsEqual(value, "verbose"))
return LogLevel::DEBUG;
else
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");
#endif
#ifdef HAVE_SYSLOG
} else if (strcmp(param->value.c_str(), "syslog") == 0) {
} else if (StringIsEqual(param->value.c_str(), "syslog")) {
LogInitSysLog();
#endif
} else {