@ -26,7 +26,9 @@
# include "rocksdb/status.h"
# include "rocksdb/thread_status.h"
# ifdef GetCurrentTime
# ifdef _WIN32
// Windows API macro interference
# undef DeleteFile
# undef GetCurrentTime
# endif
@ -163,7 +165,6 @@ class Env {
virtual Status GetChildren ( const std : : string & dir ,
std : : vector < std : : string > * result ) = 0 ;
# undef DeleteFile
// Delete the named file.
virtual Status DeleteFile ( const std : : string & fname ) = 0 ;
@ -650,27 +651,8 @@ class Logger {
// and format. Any log with level under the internal log level
// of *this (see @SetInfoLogLevel and @GetInfoLogLevel) will not be
// printed.
virtual void Logv ( const InfoLogLevel log_level , const char * format , va_list ap ) {
static const char * kInfoLogLevelNames [ 5 ] = { " DEBUG " , " INFO " , " WARN " ,
" ERROR " , " FATAL " } ;
if ( log_level < log_level_ ) {
return ;
}
virtual void Logv ( const InfoLogLevel log_level , const char * format , va_list ap ) ;
if ( log_level = = InfoLogLevel : : INFO_LEVEL ) {
// Doesn't print log level if it is INFO level.
// This is to avoid unexpected performance regression after we add
// the feature of log level. All the logs before we add the feature
// are INFO level. We don't want to add extra costs to those existing
// logging.
Logv ( format , ap ) ;
} else {
char new_format [ 500 ] ;
snprintf ( new_format , sizeof ( new_format ) - 1 , " [%s] %s " ,
kInfoLogLevelNames [ log_level ] , format ) ;
Logv ( new_format , ap ) ;
}
}
virtual size_t GetLogFileSize ( ) const { return kDoNotSupportGetLogFileSize ; }
// Flush to the OS buffers
virtual void Flush ( ) { }