some work in the new api:
- log_level and save_each_line moved from Log to FileLog - other fixes in loggers - DirContainer from Dirs and LoadAvg had no dependencies set git-svn-id: svn://ttmath.org/publicrep/winix/branches/0.7.x@1148 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -65,7 +65,7 @@ public:
|
||||
|
||||
void SetDependency(Log * log);
|
||||
|
||||
void Init(int log_level, bool save_each_line, int max_requests);
|
||||
void Init(int max_requests);
|
||||
|
||||
Log & operator<<(const void * s);
|
||||
Log & operator<<(const char * s);
|
||||
@@ -101,7 +101,6 @@ public:
|
||||
void SaveLog();
|
||||
void SaveLogAndClear();
|
||||
|
||||
int LogLevel();
|
||||
|
||||
|
||||
|
||||
@@ -110,9 +109,6 @@ private:
|
||||
// buffer for the log
|
||||
TextStream<std::wstring> * buffer; // IMPROVE ME this buffer should be a common buffer for all objects for a one thread
|
||||
|
||||
// log lovel from the config file
|
||||
int log_level;
|
||||
|
||||
// current level set by a modifier (e.g. log << log3)
|
||||
int current_level;
|
||||
|
||||
@@ -123,6 +119,8 @@ private:
|
||||
// how many request to save at once
|
||||
int max_requests;
|
||||
|
||||
|
||||
// IMPROVE ME now we don't know how many lines there are in the buffer as the buffer can be used by other Logs
|
||||
// how many lines there are in the buffer
|
||||
int lines;
|
||||
|
||||
@@ -130,8 +128,6 @@ private:
|
||||
// default: 5000
|
||||
int max_lines;
|
||||
|
||||
// whether to save each line (for debug)
|
||||
bool save_each_line;
|
||||
|
||||
FileLog * file_log;
|
||||
|
||||
@@ -147,7 +143,7 @@ void Log::LogString(const StringType & value, size_t max_size)
|
||||
{
|
||||
size_t min_size = value.size() < max_size ? value.size() : max_size;
|
||||
|
||||
if( current_level <= log_level && buffer )
|
||||
if( current_level <= file_log->get_log_level() && buffer )
|
||||
{
|
||||
for(size_t i=0 ; i<min_size ; ++i)
|
||||
{
|
||||
@@ -164,7 +160,7 @@ size_t min_size = value.size() < max_size ? value.size() : max_size;
|
||||
template<typename char_type, size_t stack_size, size_t heap_block_size>
|
||||
Log & Log::operator<<(const PT::TextStreamBase<char_type, stack_size, heap_block_size> & buf)
|
||||
{
|
||||
if( current_level <= log_level && buffer )
|
||||
if( current_level <= file_log->get_log_level() && buffer )
|
||||
(*buffer) << buf;
|
||||
|
||||
return *this;
|
||||
|
||||
Reference in New Issue
Block a user