Skip to content

Instantly share code, notes, and snippets.

@tternes
Created March 21, 2017 12:28
Show Gist options
  • Save tternes/dee46f99028432b732b6d69ac0578bee to your computer and use it in GitHub Desktop.
Save tternes/dee46f99028432b732b6d69ac0578bee to your computer and use it in GitHub Desktop.
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