updated to the new pikotools api - we have a logger for morm and ezc

pikotools has now Log and FileLog classes
which are base classes for winix Log and FileLog classes




git-svn-id: svn://ttmath.org/publicrep/winix/branches/0.7.x@1151 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2018-11-23 17:53:43 +00:00
parent 491dd27ebf
commit b90445de4a
35 changed files with 1163 additions and 1364 deletions

View File

@@ -39,8 +39,8 @@
#include <fstream>
#include <iostream>
#include <string>
#include "textstream.h"
#include "core/synchro.h"
#include "log/log.h"
@@ -49,17 +49,16 @@ namespace Winix
class TimeZones;
class FileLog
class FileLog : public PT::FileLog
{
public:
FileLog();
~FileLog();
virtual ~FileLog();
void set_synchro(Synchro * synchro);
void init(const std::wstring & log_file, bool log_stdout, int log_level, bool save_each_line, size_t log_time_zone_id);
void save_log(TextStream<std::wstring> * buffer);
void set_time_zones(TimeZones * time_zones);
PT::Date get_local_date(const PT::Date & date);
@@ -67,17 +66,9 @@ public:
int get_log_level();
bool should_save_each_line();
private:
// file log
std::string log_file;
std::ofstream file;
// logging to stdout
bool log_stdout;
// is the config file already open
bool log_file_open;
protected:
size_t log_time_zone_id;
@@ -85,14 +76,11 @@ private:
Synchro * synchro;
// log lovel from the config file
int log_level;
// whether to save each line (for debug)
bool save_each_line;
virtual bool synchro_lock();
virtual void synchro_unlock();
void open_file();
};