Commit 2000bbf3 authored by fmg005's avatar fmg005

Added default constructor to CLA_Logger and ability to log timestamped files

parent aebd7521
#include "CLA_Logger.h"
CLA::LOGGER::LOGGER() {
m_logstream.open(current_time(false)+".log");
}
CLA::LOGGER::LOGGER(const string& filename): m_filename(move(filename)) {
......@@ -16,9 +19,9 @@ string CLA::LOGGER::current_time(bool display_tz){
timeinfo = localtime(&now);
if (display_tz)
strftime(buffer, 50, "%Y-%M-%d %X-%Z", timeinfo);
strftime(buffer, 50, "%Y-%M-%d.%X-%Z", timeinfo);
else
strftime(buffer, 50, "%Y-%M-%d %X", timeinfo);
strftime(buffer, 50, "%Y-%M-%d.%X", timeinfo);
return buffer;
}
......
......@@ -25,7 +25,7 @@ namespace CLA {
string current_time(bool);
string set_level(LEVEL);
public:
LOGGER();
LOGGER(const string&);
~LOGGER();
......
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