Making logging to stdout the default. To disable logging use --log-level NONE
This commit is contained in:
@@ -114,15 +114,9 @@ daggy::GeneralLogger getLogger(const std::string &logFile,
|
||||
daggy::LogLevel level, std::ofstream &ofh)
|
||||
{
|
||||
if (logFile == "-") {
|
||||
std::cout << "Logging to cout" << std::endl;
|
||||
return daggy::GeneralLogger(std::cout, level);
|
||||
}
|
||||
if (logFile == "") {
|
||||
std::cout << "No logging" << std::endl;
|
||||
return daggy::GeneralLogger(std::cout, daggy::LogLevel::NONE);
|
||||
}
|
||||
|
||||
std::cout << "Logging to " << logFile << std::endl;
|
||||
ofh.open(logFile, std::ios::ate | std::ios::binary);
|
||||
if (!ofh.good()) {
|
||||
throw std::runtime_error("Unable to open log file " + logFile);
|
||||
@@ -140,7 +134,7 @@ int main(int argc, char **argv)
|
||||
.implicit_value(true);
|
||||
args.add_argument("-d", "--daemon").default_value(false).implicit_value(true);
|
||||
args.add_argument("--config").default_value(std::string{});
|
||||
args.add_argument("--log-file").default_value(std::string{});
|
||||
args.add_argument("--log-file").default_value(std::string{"-"});
|
||||
args.add_argument("--log-level").default_value(std::string{"NONE"});
|
||||
args.add_argument("--ip").default_value(std::string{"127.0.0.1"});
|
||||
args.add_argument("--port").default_value(2504u).action(
|
||||
|
||||
Reference in New Issue
Block a user