we can create links (hard links, symbolic links) now

added winix functions: ln

winix function 'default' can be used without redirecting now

added new tickets types: TypeProgress, TypeString, TypeMultistring, TypeImages, TypeFiles
now tickets are combined with files
added winix functions: showtickets

fixed mountpoints:
when the default root mount was created its parameter table was empty
and it caused accessing to a non-existing objects

fixed logger:
modifiers (log1, log2, log3) were incorrectly treated
added modifier: log4 (debug info)

now we are moving threads to a new plugin 'thread'
created directory: plugins/thread
(not finished yet)




git-svn-id: svn://ttmath.org/publicrep/winix/trunk@704 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2011-01-05 21:24:11 +00:00
parent bb83aed20d
commit 8154c403d8
113 changed files with 5840 additions and 2972 deletions

View File

@@ -15,21 +15,29 @@
Log::Log()
{
log_level = 3;
current_level = 4; // nothing to log (call Init() first)
item = 0;
item_save = 1;
log_level = 1;
current_level = 100; // nothing to log (call Init() first)
request = 0;
max_requests = 1;
lines = 0;
max_lines = 5000;
log_file_open = false;
}
void Log::Init(int log_l, const std::string & log_f, bool log_std, int log_request)
Log::~Log()
{
log_level = log_l;
log_file = log_f;
log_stdout = log_std;
item_save = log_request;
SaveLogAndClear();
}
void Log::Init(int log_level_, bool save_each_line_, const std::string & log_file_, bool log_std, int log_max_requests)
{
log_level = log_level_;
log_file = log_file_;
log_stdout = log_std;
max_requests = log_max_requests;
save_each_line = save_each_line_;
// don't open the file here
// because it would be created with the root as an owner
@@ -67,6 +75,9 @@ void Log::PutDate(Manipulators m)
Log & Log::operator<<(const void * s)
{
if( current_level > log_level )
return *this;
buffer << s;
return *this;
}
@@ -75,6 +86,9 @@ Log & Log::operator<<(const void * s)
Log & Log::operator<<(const char * s)
{
if( current_level > log_level )
return *this;
if( !s )
return *this;
@@ -87,7 +101,10 @@ return *this;
Log & Log::operator<<(const std::string & s)
{
buffer << s;
if( current_level > log_level )
return *this;
buffer << s;
return *this;
}
@@ -95,7 +112,10 @@ Log & Log::operator<<(const std::string & s)
Log & Log::operator<<(const std::string * s)
{
buffer << *s;
if( current_level > log_level )
return *this;
buffer << *s;
return *this;
}
@@ -106,10 +126,11 @@ Log & Log::operator<<(const std::string * s)
Log & Log::operator<<(const wchar_t * s)
{
if( !s )
return *this;
buffer << s;
if( current_level <= log_level )
{
if( s )
buffer << s;
}
return *this;
}
@@ -118,7 +139,11 @@ return *this;
Log & Log::operator<<(const std::wstring & s)
{
buffer << s;
if( current_level <= log_level )
{
buffer << s;
}
return *this;
}
@@ -126,7 +151,11 @@ Log & Log::operator<<(const std::wstring & s)
Log & Log::operator<<(const std::wstring * s)
{
buffer << *s;
if( current_level <= log_level )
{
buffer << *s;
}
return *this;
}
@@ -136,7 +165,11 @@ Log & Log::operator<<(const std::wstring * s)
Log & Log::operator<<(int s)
{
buffer << s;
if( current_level <= log_level )
{
buffer << s;
}
return *this;
}
@@ -144,7 +177,11 @@ Log & Log::operator<<(int s)
Log & Log::operator<<(long s)
{
buffer << s;
if( current_level <= log_level )
{
buffer << s;
}
return *this;
}
@@ -153,7 +190,11 @@ Log & Log::operator<<(long s)
Log & Log::operator<<(char s)
{
buffer << s;
if( current_level <= log_level )
{
buffer << s;
}
return *this;
}
@@ -161,7 +202,11 @@ Log & Log::operator<<(char s)
Log & Log::operator<<(size_t s)
{
buffer << s;
if( current_level <= log_level )
{
buffer << s;
}
return *this;
}
@@ -169,7 +214,11 @@ Log & Log::operator<<(size_t s)
Log & Log::operator<<(double s)
{
buffer << s;
if( current_level <= log_level )
{
buffer << s;
}
return *this;
}
@@ -180,36 +229,23 @@ Log & Log::operator<<(Manipulators m)
switch(m)
{
case logend:
buffer << '\n';
lines += 1;
//if( lines > 3000 )
if( current_level <= log_level )
{
SaveLog();
buffer.Clear();
item = 0;
lines = 0;
buffer << '\n';
lines += 1;
if( save_each_line )
SaveLogAndClear();
}
break;
case logsavenow:
SaveLog();
buffer.Clear();
item = 0;
lines = 0;
break;
case logsave:
item += 1;
SaveLogAndClear();
break;
if( item >= item_save || lines > 3000 )
{
SaveLog();
buffer.Clear();
item = 0;
lines = 0;
}
case logendrequest:
if( ++request >= max_requests || lines > max_lines )
SaveLogAndClear();
break;
case log1:
@@ -223,6 +259,10 @@ Log & Log::operator<<(Manipulators m)
case log3:
current_level = 3;
break;
case log4:
current_level = 4;
break;
}
return *this;
@@ -240,12 +280,18 @@ void Log::SystemErr(int err)
}
void Log::SaveLogAndClear()
{
SaveLog();
buffer.Clear();
request = 0;
lines = 0;
}
void Log::SaveLog()
{
if( current_level > log_level )
return;
if( buffer.Str().empty() )
return;