summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorAndrew Opalach <andrew@akon.city> 2025-04-17 10:03:43 -0400
committerAndrew Opalach <andrew@akon.city> 2025-04-17 10:03:43 -0400
commiteccba12e1fe3c1b9510e274cd8ddfa94bba6f489 (patch)
tree43cef769c453fcb3854f80cb5f1831d512098167 /src/util
parentae8822ec0327c4d5674f1dc79de926b230f27f1f (diff)
downloadcamu-eccba12e1fe3c1b9510e274cd8ddfa94bba6f489.tar.gz
camu-eccba12e1fe3c1b9510e274cd8ddfa94bba6f489.tar.bz2
camu-eccba12e1fe3c1b9510e274cd8ddfa94bba6f489.zip
Implement logging changes and cleanup
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'src/util')
-rw-r--r--src/util/color_palette.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/util/color_palette.c b/src/util/color_palette.c
index d386858..fc26a10 100644
--- a/src/util/color_palette.c
+++ b/src/util/color_palette.c
@@ -49,7 +49,7 @@ bool camu_color_palette_init(str *path)
json_t *root = json_loadb(buffer.data, buffer.length, 0, &error);
al_str_free(&buffer);
if (!root) {
- error("Failed to load %.*s as a json (%s).", al_str_x(path), error.text);
+ log_error("Failed to load %.*s as a json (%s).", al_str_x(path), error.text);
return false;
}
@@ -57,14 +57,14 @@ bool camu_color_palette_init(str *path)
json_t *special = json_object_get(root, "special");
if (!special) {
- error("\"special\" field missing from the color palette.");
+ log_error("\"special\" field missing from the color palette.");
parsed = false;
goto out;
}
json_t *colors = json_object_get(root, "colors");
if (!colors) {
- error("\"colors\" field missing from the color palette.");
+ log_error("\"colors\" field missing from the color palette.");
parsed = false;
goto out;
}
@@ -78,7 +78,7 @@ bool camu_color_palette_init(str *path)
for (u32 i = 0; i < ARRAY_SIZE(special_colors); i++) {
object = json_object_get(special, special_colors[i]);
if (!object) {
- error("Couldn't find special color: %s.", special_colors[i]);
+ log_error("Couldn't find special color: %s.", special_colors[i]);
return false;
}
color = json_string_value(object);
@@ -87,14 +87,14 @@ bool camu_color_palette_init(str *path)
if (!to_long_error) {
global_color_palette.colors[i] = value;
} else {
- warn("%s is not a valid hex color.", normal_colors[i]);
+ log_warn("%s is not a valid hex color.", normal_colors[i]);
}
}
for (u32 i = 0; i < ARRAY_SIZE(normal_colors); i++) {
object = json_object_get(colors, normal_colors[i]);
if (!object) {
- error("Couldn't find color: %s.", normal_colors[i]);
+ log_error("Couldn't find color: %s.", normal_colors[i]);
return false;
}
color = json_string_value(object);
@@ -103,7 +103,7 @@ bool camu_color_palette_init(str *path)
if (!to_long_error) {
global_color_palette.colors[i + 2] = value;
} else {
- warn("%s is not a valid hex color.", normal_colors[i]);
+ log_warn("%s is not a valid hex color.", normal_colors[i]);
}
}