Use proper prefixes

This commit is contained in:
Johannes Marbach 2021-09-25 14:20:54 +02:00
parent 5a3edbe843
commit 40ad7e89c2
3 changed files with 14 additions and 6 deletions

4
log.c
View file

@ -34,7 +34,7 @@ static ul_log_level log_level = UL_LOG_LEVEL_ERROR;
* Public functions
*/
void ul_set_log_level(ul_log_level level) {
void ul_log_set_level(ul_log_level level) {
log_level = level;
}
@ -49,6 +49,6 @@ void ul_log(ul_log_level level, const char *format, ...) {
va_end(args);
}
void ul_print_cb(const char *msg) {
void ul_log_print_cb(const char *msg) {
ul_log(UL_LOG_LEVEL_VERBOSE, "%s\n", msg);
}

4
log.h
View file

@ -38,7 +38,7 @@ typedef enum {
*
* @param level new log level value
*/
void ul_set_log_level(ul_log_level level);
void ul_log_set_level(ul_log_level level);
/**
* Log a message.
@ -54,6 +54,6 @@ void ul_log(ul_log_level level, const char *format, ...);
*
* @param msg message to print
*/
void ul_print_cb(const char *msg);
void ul_log_print_cb(const char *msg);
#endif /* UL_LOG_H */

12
main.c
View file

@ -333,9 +333,17 @@ int main(int argc, char *argv[]) {
ul_cli_opts opts;
ul_cli_parse_opts(argc, argv, &opts);
/* Parse config file */
ul_config_opts config;
ul_config_init(&config);
ul_config_parse(opts.config, &config);
printf("anim %d, pops %d, layout %d\n", config.animations, config.popovers, config.layout_id);
exit(1);
/* Set up log level */
if (opts.verbose) {
ul_set_log_level(UL_LOG_LEVEL_VERBOSE);
ul_log_set_level(UL_LOG_LEVEL_VERBOSE);
}
/* Announce ourselves */
@ -343,7 +351,7 @@ int main(int argc, char *argv[]) {
/* Initialise LVGL and set up logging callback */
lv_init();
lv_log_register_print_cb(ul_print_cb);
lv_log_register_print_cb(ul_log_print_cb);
/* Initialise framebuffer driver and query display size */
fbdev_init();