I’m not very good with terminology.. here’s the code I have:
enum {
LoggerLogNone = 0,
LoggerLogMessages = 1 << 0,
LoggerLogErrors = 1 << 1
};
typedef NSUInteger LoggerLogs;
And what I’d like to do is use LoggerLogs in my logic when determining whether or not it should be logged. So in my log:(NSString *)message I want it to log ONLY if the user set LoggerLogMessages, and for logError:(NSString *)error I want it to log ONLY if the user set LoggerLogErrors..
I know how to set them:
LoggerLogs logs = LoggerLogMessages | LoggerLogErrors;
What I don’t know how to do is check if LoggerLogMessages or LoggerLogErrors is checked.
Any help would be greatly appreciated. I’m sure this is answered here somewhere, but since I don’t know the terms to use, it’s really hard to search for >_<
Both
<<and&are called bitwise operators. If you googlebitwise operators C, you’ll find lots of explanations.