From 552b2287db86ed6e77565672fbccff1d553f823f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 1 Feb 2019 12:44:19 +1100 Subject: Logging: Use CLOG for blenkernel Part of D4277 by @sobakasu --- source/blender/blenkernel/intern/icons.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'source/blender/blenkernel/intern/icons.c') diff --git a/source/blender/blenkernel/intern/icons.c b/source/blender/blenkernel/intern/icons.c index 2a348751365..b3e2c8537ea 100644 --- a/source/blender/blenkernel/intern/icons.c +++ b/source/blender/blenkernel/intern/icons.c @@ -35,6 +35,8 @@ #include #include +#include "CLG_log.h" + #include "MEM_guardedalloc.h" #include "DNA_brush_types.h" @@ -77,6 +79,8 @@ enum { /* GLOBALS */ +static CLG_LogRef LOG = {"bke.icons"}; + static GHash *gIcons = NULL; static int gNextIconId = 1; @@ -588,7 +592,7 @@ int BKE_icon_id_ensure(struct ID *id) id->icon_id = get_next_free_id(); if (!id->icon_id) { - printf("%s: Internal error - not enough IDs\n", __func__); + CLOG_ERROR(&LOG, "not enough IDs"); return 0; } @@ -633,7 +637,7 @@ int BKE_icon_gplayer_color_ensure(bGPDlayer *gpl) gpl->runtime.icon_id = get_next_free_id(); if (!gpl->runtime.icon_id) { - printf("%s: Internal error - not enough IDs\n", __func__); + CLOG_ERROR(&LOG, "not enough IDs"); return 0; } @@ -665,7 +669,7 @@ int BKE_icon_preview_ensure(ID *id, PreviewImage *preview) preview->icon_id = get_next_free_id(); if (!preview->icon_id) { - printf("%s: Internal error - not enough IDs\n", __func__); + CLOG_ERROR(&LOG, "not enough IDs"); return 0; } @@ -690,7 +694,7 @@ Icon *BKE_icon_get(const int icon_id) icon = BLI_ghash_lookup(gIcons, POINTER_FROM_INT(icon_id)); if (!icon) { - printf("%s: Internal error, no icon for icon ID: %d\n", __func__, icon_id); + CLOG_ERROR(&LOG, "no icon for icon ID: %d", icon_id); return NULL; } @@ -704,7 +708,7 @@ void BKE_icon_set(const int icon_id, struct Icon *icon) void **val_p; if (BLI_ghash_ensure_p(gIcons, POINTER_FROM_INT(icon_id), &val_p)) { - printf("%s: Internal error, icon already set: %d\n", __func__, icon_id); + CLOG_ERROR(&LOG, "icon already set: %d", icon_id); return; } -- cgit v1.2.3