Skip to content

Instantly share code, notes, and snippets.

@xslim
Last active May 28, 2018 07:55
Show Gist options
  • Save xslim/e8e0a59dcd36ec6034d2 to your computer and use it in GitHub Desktop.
Save xslim/e8e0a59dcd36ec6034d2 to your computer and use it in GitHub Desktop.
Logging proxy sample
// Simple way
void custom_log_renderer_line(const char *str) {
// or save to file ?
printf("%s\n", str);
}
// OR Advanced way
void custom_log_renderer_linec(const char *component, int level, const char *prefix, const char *str) {
printf("%d %s: %s: %s\n", level, component, prefix, str);
}
+ (void)setup {
// Lib to Warning
adylog_configure_by_name("*", adylog_vWarning);
// Simple way
// Custom line output
adylog_set_render_line(custom_log_renderer_line);
// OR Advanced way
// Custom non formatted line output
adylog_set_render_linec(custom_log_renderer_linec);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment