View Single Post
Dr. McKay
Sir Dr. SourceMod Plugin Approver Esq. Ltd. M.D. PhD
Join Date: Aug 2011
Location: Atlantis
Old 02-27-2015 , 14:09   Re: logdebug.inc - Simple debug logging
Reply With Quote #11

Quote:
Originally Posted by Powerlord View Post
Make the variables in this static on the off chance that a plugin is already using variables with these names.
Wouldn't work since both InitDebugLog and LogDebug need access.

Quote:
Originally Posted by Powerlord View Post
Check if char works for single characters instead of using an int. (int flagChar = '0'; looks weird to say the least).
bool FindFlagChar(AdminFlag flag, int &c)

Would need to use view_as<int> anyway. I agree that it's weird but it is what it is.

Quote:
Originally Posted by Powerlord View Post
adminFlag should be optional. After all, if you don't include DEBUG_ADMIN_CONSOLE or DEBUG_ADMIN_CHAT, it isn't used. Perhaps use ADMFLAG_GENERIC as the default value for adminFlag?
Agreed. Fixing.

Quote:
Originally Posted by Powerlord View Post
Adjust InitDebugLog to process multiple admin flags correctly or convert it to use AdminFlag types in its signature instead. Right now, the BitToFlag line looks like it's going to barf if I pass in ADMFLAG_KICK|ADMFLAG_BAN for example. This is perfectly acceptable to CheckCommandAccess and will only match if an admin has both flags.
Done.
__________________
Dr. McKay is offline