Created
March 21, 2017 12:28
-
-
Save tternes/dee46f99028432b732b6d69ac0578bee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static EVILoggingCallback s_callback = nil; | |
#pragma mark - | |
void EVILog(EVILogLevel level, NSString *fmt, ...) | |
{ | |
va_list ap; | |
va_start(ap, fmt); | |
if(s_callback) | |
{ | |
s_callback(level, [[NSString alloc] initWithFormat:fmt arguments:ap]); | |
} | |
va_end(ap); | |
} | |
#pragma mark - Callback | |
void EVIRegisterLoggingCallback(EVILoggingCallback callback) | |
{ | |
s_callback = callback; | |
} | |
void EVIUnregisterLoggingCallback() | |
{ | |
s_callback = nil; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment