diff --git a/winixd/core/app.cpp b/winixd/core/app.cpp index f73b41c..83c103b 100644 --- a/winixd/core/app.cpp +++ b/winixd/core/app.cpp @@ -68,8 +68,8 @@ App::App() file_log.set_synchro(&synchro); file_log.set_time_zones(&system.time_zones); - log.SetLogBuffer(&log_buffer); - log.SetFileLog(&file_log); + log.set_log_buffer(&log_buffer); + log.set_file_log(&file_log); // objects dependency for main thread winix_base.set_config(&config); diff --git a/winixd/core/basethread.cpp b/winixd/core/basethread.cpp index 06c6beb..ce8ebbb 100644 --- a/winixd/core/basethread.cpp +++ b/winixd/core/basethread.cpp @@ -56,13 +56,13 @@ BaseThread::~BaseThread() void BaseThread::set_main_log_buffer(pt::WTextStream * log_buffer) { - main_log.SetLogBuffer(log_buffer); + main_log.set_log_buffer(log_buffer); } void BaseThread::set_main_file_log(pt::FileLog * file_log) { - main_log.SetFileLog(file_log); + main_log.set_file_log(file_log); } diff --git a/winixd/core/config.cpp b/winixd/core/config.cpp index 973afd4..fccc492 100644 --- a/winixd/core/config.cpp +++ b/winixd/core/config.cpp @@ -51,13 +51,13 @@ Config::Config() void Config::SetFileLog(FileLog * file_log) { - log.SetFileLog(file_log); + log.set_file_log(file_log); } void Config::SetLogBuffer(pt::WTextStream * log_buffer) { - log.SetLogBuffer(log_buffer); + log.set_log_buffer(log_buffer); } diff --git a/winixd/core/log.cpp b/winixd/core/log.cpp index 93fa31b..4fb34e7 100644 --- a/winixd/core/log.cpp +++ b/winixd/core/log.cpp @@ -271,33 +271,33 @@ return *this; - -Log & Log::LogString(const std::string & value, size_t max_size) +/* +Log & Log::put_string(const std::string & value, size_t max_size) { - pt::Log::LogString(value, max_size); + pt::Log::put_string(value, max_size); return *this; } -Log & Log::LogString(const std::wstring & value, size_t max_size) +Log & Log::put_string(const std::wstring & value, size_t max_size) { - pt::Log::LogString(value, max_size); + pt::Log::put_string(value, max_size); return *this; } -Log & Log::LogBinary(const char * blob, size_t blob_len) +Log & Log::put_binary_blob(const char * blob, size_t blob_len) { - pt::Log::LogBinary(blob, blob_len); + pt::Log::put_binary_blob(blob, blob_len); return *this; } -Log & Log::LogBinary(const std::string & blob) +Log & Log::put_binary_blob(const std::string & blob) { - pt::Log::LogBinary(blob); + pt::Log::put_binary_blob(blob); return *this; } - +*/ diff --git a/winixd/core/log.h b/winixd/core/log.h index 234f6b0..bde617b 100644 --- a/winixd/core/log.h +++ b/winixd/core/log.h @@ -44,6 +44,8 @@ #include "logmanipulators.h" #include "filelog.h" #include "log/log.h" +#include "morm.h" + namespace Winix @@ -86,11 +88,13 @@ public: Log & operator<<(const pt::TextStreamBase & buf); - virtual Log & LogString(const std::string & value, size_t max_size); - virtual Log & LogString(const std::wstring & value, size_t max_size); + /* + virtual Log & put_string(const std::string & value, size_t max_size); + virtual Log & put_string(const std::wstring & value, size_t max_size); - virtual Log & LogBinary(const char * blob, size_t blob_len); - virtual Log & LogBinary(const std::string & blob); + virtual Log & put_binary_blob(const char * blob, size_t blob_len); + virtual Log & put_binary_blob(const std::string & blob); + */ //virtual Log & SystemErr(int err); diff --git a/winixd/core/logmanipulators.h b/winixd/core/logmanipulators.h index b53f05f..c2af08a 100644 --- a/winixd/core/logmanipulators.h +++ b/winixd/core/logmanipulators.h @@ -69,8 +69,14 @@ enum LogManipulators logend, logsave, + /* + * it is needed here? + */ logendrequest, + /* + * it would be better to the SLog to have its own manipulators + */ loginfo, logerror, logwarning diff --git a/winixd/core/postmultiparser.cpp b/winixd/core/postmultiparser.cpp index f369c23..837f257 100644 --- a/winixd/core/postmultiparser.cpp +++ b/winixd/core/postmultiparser.cpp @@ -256,7 +256,7 @@ void PostMultiParser::LogFirst(const std::string & to_log, size_t len) log << "empty"; log << "): \""; - log.LogString(to_log, len); + log.put_string(to_log, len); log << "\"" << logend; } diff --git a/winixd/core/postparser.h b/winixd/core/postparser.h index e9535cd..ccf1728 100644 --- a/winixd/core/postparser.h +++ b/winixd/core/postparser.h @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2008-2018, Tomasz Sowa + * Copyright (c) 2008-2021, Tomasz Sowa * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -85,7 +85,7 @@ protected: log << "(first " << log_value_size << " characters) "; log << "\""; - log.LogString(value, log_value_size); + log.put_string(value, log_value_size); log << "\" (size: " << value.size() << ")"; } diff --git a/winixd/core/threadmanager.cpp b/winixd/core/threadmanager.cpp index 40eb1b3..4b6a2bc 100644 --- a/winixd/core/threadmanager.cpp +++ b/winixd/core/threadmanager.cpp @@ -82,8 +82,8 @@ void ThreadManager::Add(BaseThread * pbase, const wchar_t * thread_name) item.object->set_dependency(this); // main log buffer (from the main thread) - item.object->set_main_log_buffer(log.GetLogBuffer()); - item.object->set_main_file_log(log.GetFileLog()); + item.object->set_main_log_buffer(log.get_log_buffer()); + item.object->set_main_file_log(log.get_file_log()); // the logger buffer and model_connector are different item.object->set_log_buffer(&data.log_buffer); @@ -200,7 +200,7 @@ void ThreadManager::StopAll() // the thread is stopped and we can set the thread log buffer pointing to // the main log buffer (from the main thread) - item.object->set_log_buffer(log.GetLogBuffer()); + item.object->set_log_buffer(log.get_log_buffer()); delete item.thread_item_data; item.thread_item_data = nullptr; diff --git a/winixd/core/winixbase.cpp b/winixd/core/winixbase.cpp index d8956b1..010f322 100644 --- a/winixd/core/winixbase.cpp +++ b/winixd/core/winixbase.cpp @@ -65,13 +65,13 @@ void WinixBase::set_synchro(Synchro * synchro) void WinixBase::set_log_buffer(pt::WTextStream * log_buffer) { - log.SetLogBuffer(log_buffer); + log.set_log_buffer(log_buffer); } void WinixBase::set_file_log(FileLog * file_log) { - log.SetFileLog(file_log); + log.set_file_log(file_log); }