Last active
May 28, 2018 07:55
-
-
Save xslim/e8e0a59dcd36ec6034d2 to your computer and use it in GitHub Desktop.
Logging proxy sample
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
// 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