TerraForge3D  2.3.1
3D Terrain And Landscape Generator
Logger.cpp
1#include "Base/Logging/Logger.h"
2#include "Platform.h"
3
4#include <ctime>
5#include <iostream>
6
7Logger::Logger(std::string logsDir)
8{
9 time_t rawtime;
10 struct tm *timeinfo;
11 char buffer[80];
12 time (&rawtime);
13 timeinfo = localtime(&rawtime);
14 strftime(buffer, sizeof(buffer), "%A %d-%m-%Y %I-%M-%S %p", timeinfo);
15 std::string str(buffer);
16 str += ".txt";
17 mLogHandler = new LoggingOutputStreambuf(std::cout, logsDir + PATH_SEPARATOR + str);
18}
19
20Logger::~Logger()
21{
22 delete mLogHandler;
23}