Commit 36e95aa1 authored by Stephen Morris's avatar Stephen Morris
Browse files

[trac555] Use getSeverity() instead of explicitly checking severity string

parent 0692e63e
...@@ -25,7 +25,10 @@ ...@@ -25,7 +25,10 @@
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <util/strutil.h>
#include <log/logger.h> #include <log/logger.h>
#include <log/logger_level.h>
#include <log/logger_manager.h> #include <log/logger_manager.h>
#include <log/logger_specification.h> #include <log/logger_specification.h>
#include <log/macros.h> #include <log/macros.h>
...@@ -128,24 +131,10 @@ int main(int argc, char** argv) { ...@@ -128,24 +131,10 @@ int main(int argc, char** argv) {
return (0); return (0);
case 's': case 's':
if (strcmp(optarg, "debug") == 0) { {
spec.setSeverity(isc::log::DEBUG); string severity(optarg);
isc::util::str::uppercase(severity);
} else if (strcmp(optarg, "info") == 0) { spec.setSeverity(getSeverity(severity));
spec.setSeverity(isc::log::INFO);
} else if (strcmp(optarg, "warn") == 0) {
spec.setSeverity(isc::log::WARN);
} else if (strcmp(optarg, "error") == 0) {
spec.setSeverity(isc::log::ERROR);
} else if (strcmp(optarg, "fatal") == 0) {
spec.setSeverity(isc::log::FATAL);
} else {
cerr << "Unrecognised severity option: " << optarg << "\n";
return (1);
} }
break; break;
......
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