From 6e106a2cc52e3857cbd55d67d54b4589f3425c51 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Sat, 20 Oct 2007 20:51:59 +0000 Subject: Made the logger use a uint32_t for it's mask, no more negative confusion. Also brought back the formula class with some cool twists, and added a basic stack class, very cute, fast, and little. --- src/logger.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/logger.cpp') diff --git a/src/logger.cpp b/src/logger.cpp index 8c058d1..fe6a916 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -12,7 +12,7 @@ Bu::Logger::~Logger() { } -void Bu::Logger::log( int nLevel, const char *sFile, const char *sFunction, int nLine, const char *sFormat, ...) +void Bu::Logger::log( uint32_t nLevel, const char *sFile, const char *sFunction, int nLine, const char *sFormat, ...) { if( (nLevel&nLevelMask) == 0 ) return; @@ -112,12 +112,17 @@ void Bu::Logger::setFormat( const Bu::FString &str ) //write( fileno(stdout), sLogFormat.getStr(), sLogFormat.getSize() ); } -void Bu::Logger::setMask( int n ) +void Bu::Logger::setMask( uint32_t n ) { nLevelMask = n; } -void Bu::Logger::setLevel( int n ) +uint32_t Bu::Logger::getMask() +{ + return nLevelMask; +} + +void Bu::Logger::setLevel( uint32_t n ) { int j; for( j = 31; j > 0; j-- ) @@ -134,8 +139,8 @@ void Bu::Logger::setLevel( int n ) } } -void Bu::Logger::hexDump( int nLevel, const char *sFile, const char *sFunction, - int nLine, const void *pDataV, long nDataLen, +void Bu::Logger::hexDump( uint32_t nLevel, const char *sFile, + const char *sFunction, int nLine, const void *pDataV, long nDataLen, const char *lpName ) { log( nLevel, sFile, sFunction, nLine, "Displaying %ld bytes of %s.", nDataLen, lpName ); @@ -176,3 +181,4 @@ void Bu::Logger::hexDump( int nLevel, const char *sFile, const char *sFunction, } log( nLevel, sFile, sFunction, nLine, sBorder.getStr() ); } + -- cgit v1.2.3