start working on 0.7.x branch

- added FileLog which stores content to the file log
- now Log is only a wrapper - it puts messages to the local buffer and when logsave is used then the buffer is put to FileLog
- new base classes:
  WinixBase (Log, Config*, Synchro*)
  WinixModel : public WinixBase (morm::ModelConnector*, Plugin*)
  WinixSystem : public WinixModel (System*)
  WinixRequest : public WinixSystem (SLog, Cur*)
- singletons: log, slog, plugin are depracated - now references to them are in base classses (WinixBase, WinixModel)
- DbBase,  DbConn and Db are depracated - now we are using Morm project (in WinixModel there is a model_connector pointer)
  each thread will have its own ModelConnector





git-svn-id: svn://ttmath.org/publicrep/winix/branches/0.7.x@1146 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2018-11-21 11:03:53 +00:00
parent a7c47140ae
commit a2ffc1e81c
121 changed files with 7832 additions and 6662 deletions

View File

@@ -38,7 +38,6 @@
#include <fstream>
#include <cstdlib>
#include "misc.h"
#include "log.h"
#include "templates/templates.h"
#include "convert/convert.h"
@@ -882,7 +881,7 @@ char dir_name[WINIX_OS_PATH_SIZE];
if( mkdir(dir_name, 0777) < 0 )
{
log << log1 << "Can't create a directory on fs: " << dir << logend;
//log << log1 << "Can't create a directory on fs: " << dir << logend;
return false;
}
@@ -958,7 +957,7 @@ char buffer[512];
if( getgrnam_r(group_name, &gr, buffer, sizeof(buffer)/sizeof(char), &result) != 0 )
{
log << log1 << "Misc: I cannot get the group_id for group name: " << name << logend;
//log << log1 << "Misc: I cannot get the group_id for group name: " << name << logend;
return -1;
}
@@ -967,7 +966,7 @@ char buffer[512];
*/
if( result == 0 )
{
log << log1 << "Misc: There is no a group with name: " << name << logend;
//log << log1 << "Misc: There is no a group with name: " << name << logend;
return -1;
}
@@ -994,7 +993,7 @@ char file_name[WINIX_OS_PATH_SIZE];
if( chmod(file_name, priv) < 0 )
{
log << log1 << "Misc: Can't set proper fs privileges on: " << name << logend;
//log << log1 << "Misc: Can't set proper fs privileges on: " << name << logend;
return false;
}
@@ -1002,8 +1001,8 @@ char file_name[WINIX_OS_PATH_SIZE];
{
if( chown(file_name, geteuid(), group) < 0 )
{
log << log1 << "Can't set proper fs group on: " << name
<< ", group id was: " << group << logend;
//log << log1 << "Can't set proper fs group on: " << name
// << ", group id was: " << group << logend;
return false;
}
}
@@ -1385,7 +1384,9 @@ void RemovePostFileTmp(PostFileTab & post_file_tab)
const std::wstring & tmp_filename = i->second.tmp_filename;
if( !tmp_filename.empty() && RemoveFile(tmp_filename) )
log << log3 << "Deleted tmp file: " << tmp_filename << logend;
{
//log << log3 << "Deleted tmp file: " << tmp_filename << logend;
}
}
}
@@ -1399,8 +1400,8 @@ bool WideToUTF8(const wchar_t * wide_string, char * utf8, size_t utf8_size)
/*
* either the 'utf8' buffer is too small or there was an error when converting
*/
log << log1 << "Misc: I cannot convert from a wide string to an UTF-8 string, original string was: "
<< wide_string << logend;
//log << log1 << "Misc: I cannot convert from a wide string to an UTF-8 string, original string was: "
// << wide_string << logend;
}
return res;