|
|
|
@ -1,4 +1,3 @@
|
|
|
|
|
// #include <cstdlib>
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <fstream>
|
|
|
|
|
|
|
|
|
@ -16,7 +15,8 @@ int main(int argc, char* argv[])
|
|
|
|
|
if (argparser.useConsole()) {
|
|
|
|
|
Logger::getInstance()->setStream(&std::cout);
|
|
|
|
|
} else {
|
|
|
|
|
logfile.open (argparser.logFile(), std::ios::out | std::ios::app);
|
|
|
|
|
logfile.open (argparser.logFile(),
|
|
|
|
|
std::ios::out | std::ios::app);
|
|
|
|
|
if (!logfile.is_open()) {
|
|
|
|
|
std::cerr << "Could not open file '" <<
|
|
|
|
|
argparser.logFile() << "' to append." << std::endl;
|
|
|
|
@ -25,8 +25,9 @@ int main(int argc, char* argv[])
|
|
|
|
|
Logger::getInstance()->setStream(&logfile);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LOG << "hello" << std::endl;
|
|
|
|
|
std::string line;
|
|
|
|
|
while (std::getline(std::cin, line))
|
|
|
|
|
LOG << line << std::endl;
|
|
|
|
|
|
|
|
|
|
if (!argparser.useConsole())
|
|
|
|
|
logfile.close();
|
|
|
|
|