added: now winix will not log post parameters with 'pass' in names (at the beginning)
changed: only first few characters are logged (from POST) git-svn-id: svn://ttmath.org/publicrep/winix/trunk@733 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
27
core/log.h
27
core/log.h
@@ -2,7 +2,7 @@
|
||||
* This file is a part of Winix
|
||||
* and is not publicly distributed
|
||||
*
|
||||
* Copyright (c) 2008-2010, Tomasz Sowa
|
||||
* Copyright (c) 2008-2011, Tomasz Sowa
|
||||
* All rights reserved.
|
||||
*
|
||||
*/
|
||||
@@ -48,10 +48,14 @@ public:
|
||||
Log & operator<<(int s);
|
||||
Log & operator<<(long s);
|
||||
Log & operator<<(char s);
|
||||
Log & operator<<(wchar_t s);
|
||||
Log & operator<<(size_t s);
|
||||
Log & operator<<(double s);
|
||||
Log & operator<<(Manipulators m);
|
||||
|
||||
|
||||
template<class StringType>
|
||||
void LogString(const StringType & value, size_t max_size);
|
||||
|
||||
void SystemErr(int err);
|
||||
void SaveLog();
|
||||
void SaveLogAndClear();
|
||||
@@ -100,6 +104,25 @@ private:
|
||||
|
||||
|
||||
|
||||
template<class StringType>
|
||||
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 )
|
||||
{
|
||||
for(size_t i=0 ; i<min_size ; ++i)
|
||||
{
|
||||
if( value[i] < 32 )
|
||||
buffer << '.';
|
||||
else
|
||||
buffer << value[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
extern Log log;
|
||||
extern Log nlog;
|
||||
|
||||
|
Reference in New Issue
Block a user