View Single Post
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 02-27-2015 , 13:37   Re: logdebug.inc - Simple debug logging
Reply With Quote #10

A few optional things you might want to do:
  • Make the variables in this static on the off chance that a plugin is already using variables with these names.
  • Check if char works for single characters instead of using an int. (int flagChar = '0'; looks weird to say the least).
  • 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?
  • 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.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline