View Single Post
Chdata
Veteran Member
Join Date: Aug 2012
Location: Computer Chair, Illinois
Old 02-27-2015 , 16:15   Re: logdebug.inc - Simple debug logging
Reply With Quote #13

Quote:
Originally Posted by ddhoward View Post
PHP Code:
// define NO_DEBUG before including this file to completely disable all debugging
#if defined NO_DEBUG
 
stock void InitDebugLog(const char[] convarName, const char[] debugTagint adminFlag) { }
 
stock bool LogDebug(const char[] formatany ...) { return false; }
 
#endinput
#endif 
That is already a feature.
No... that still compiles it into your plugin, just making it return false all the time and do nothing. NOP NOP NOP

Quote:
Originally Posted by Dr. McKay View Post
Good catch. Fixed. Also added an override with the same name as the cvar.



I don't think that would be possible with LogDebug's variable number of parameters.
Code:
#if !defined DEBUG
    stock DebugMsg(any:...){}
    //#define DebugMsg(%1)
    #endinput
#endif
I do it like this, but that still compiles the function with a function call everywhere.

You can just do

#define DebugMsg 0

or something like that, and then it won't compile in your final binary, but you'll see compiler warnings.
__________________

Last edited by Chdata; 02-27-2015 at 16:19.
Chdata is offline