Raised This Month: $ Target: $400
 0% 

logdebug.inc - Simple debug logging


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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 #10

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
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:32.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode