Added a macro for conditional logging.

master
Pacman Ghost 7 years ago
parent a9517d7f92
commit d1e3bf3fc6
  1. 3
      MouseDll/core.cpp
  2. 5
      MouseDll/globals.hpp

@ -29,8 +29,7 @@ openApi( PCALLBACKFN pCallbackFn , const ApiDebugConfig* pDebugConfig )
assert( false ) ;
wcscpy_s( buf , ARRAY_SIZE(buf) , L"interception.dll" ) ;
}
if ( isLoggingEnabled( "startup" ) )
LOG_MSG( "Loading Interception: " << toUtf8(buf) ) ;
LOG_CMSG( "startup" , "Loading Interception: " << toUtf8(buf) ) ;
ghInterceptionDll = LoadLibrary( buf ) ;
if ( ghInterceptionDll == NULL )
throw runtime_error( MAKE_STRING( "Can't load Interception: " << getLastErrorString() ) ) ;

@ -31,6 +31,11 @@ extern PCALLBACKFN gpCallbackFn ;
if ( gLogFile.is_open() ) \
gLogFile << _buf_ ; \
}
#define LOG_CMSG( c , msg ) \
{ \
if ( isLoggingEnabled( c ) ) \
LOG_MSG( msg ) ; \
}
extern void initLogging( const wchar_t* ) ;
extern bool isLoggingEnabled( const std::string& ) ;

Loading…
Cancel
Save