Add log.c with info() and warn()

This commit is contained in:
Johan Malm 2020-08-12 19:37:44 +01:00
parent 5ea1527558
commit 2a17df0f8b
11 changed files with 68 additions and 17 deletions

View file

@ -8,6 +8,7 @@
#include "theme/theme.h"
#include "common/dir.h"
#include "common/log.h"
static int hex_to_dec(char c)
{
@ -96,10 +97,10 @@ void theme_read(const char *theme_name)
char themerc[4096];
snprintf(themerc, sizeof(themerc), "%s/themerc", theme_dir(theme_name));
fprintf(stderr, "info: read themerc (%s)\n", themerc);
info("reading themerc (%s)", themerc);
stream = fopen(themerc, "r");
if (!stream) {
fprintf(stderr, "warn: cannot read (%s)\n", themerc);
warn("cannot read (%s)", themerc);
return;
}
while (getline(&line, &len, stream) != -1) {