Replace all DEBUG_0() calls with log_printf() or another debug level.
This will stop the user seeing irrelevant debug output
when the debug level is set to the default of 0.
+Log Window:
+
+DEBUG_0()
+Use DEBUG_0() only for temporary debugging i.e. not in code in the repository.
+The user will then not see irrelevant debug output when the default
+debug level = 0 is used.
+
+log_printf()
+If the first word of the message is "error" or "warning" (case insensitive)
+the message will be color-coded appropriately.
+
+--------------------------------------------------------------------------------
+
GPL header, in every file, like this:
/** \file
if (fd == NULL) return NULL;
if (fd->magick != FD_MAGICK)
#ifdef DEBUG_FILEDATA
- DEBUG_0("fd magick mismatch @ %s:%d fd=%p", file, line, fd);
+ log_printf("Error: fd magick mismatch @ %s:%d fd=%p", file, line, fd);
#else
- DEBUG_0("fd magick mismatch fd=%p", fd);
+ log_printf("Error: fd magick mismatch fd=%p", fd);
#endif
g_assert(fd->magick == FD_MAGICK);
fd->ref++;
if (fd == NULL) return;
if (fd->magick != FD_MAGICK)
#ifdef DEBUG_FILEDATA
- DEBUG_0("fd magick mismatch @ %s:%d fd=%p", file, line, fd);
+ log_printf("Error: fd magick mismatch @ %s:%d fd=%p", file, line, fd);
#else
- DEBUG_0("fd magick mismatch fd=%p", fd);
+ log_printf("Error: fd magick mismatch fd=%p", fd);
#endif
g_assert(fd->magick == FD_MAGICK);
void file_data_lock(FileData *fd)
{
if (fd == NULL) return;
- if (fd->magick != FD_MAGICK) DEBUG_0("fd magick mismatch fd=%p", fd);
+ if (fd->magick != FD_MAGICK) log_printf("Error: fd magick mismatch fd=%p", fd);
g_assert(fd->magick == FD_MAGICK);
fd->locked = TRUE;
void file_data_unlock(FileData *fd)
{
if (fd == NULL) return;
- if (fd->magick != FD_MAGICK) DEBUG_0("fd magick mismatch fd=%p", fd);
+ if (fd->magick != FD_MAGICK) log_printf("Error: fd magick mismatch fd=%p", fd);
g_assert(fd->magick == FD_MAGICK);
fd->locked = FALSE;
if (fs->same_region)
{
- DEBUG_0("Original window is not visible, enabling std. fullscreen mode");
+ DEBUG_2("Original window is not visible, enabling std. fullscreen mode");
image_move_from_image(fs->imd, fs->normal_imd);
}
else
{
- DEBUG_0("Original window is still visible, enabling presentation fullscreen mode");
+ DEBUG_2("Original window is still visible, enabling presentation fullscreen mode");
image_copy_from_image(fs->imd, fs->normal_imd);
}
fd = g_file_open_tmp("geeqie_keymap_XXXXXX.svg", &tmp_file, &error);
if (error)
{
- DEBUG_0("Keyboard Map - cannot create file:%s\n",error->message);
+ log_printf("Error: Keyboard Map - cannot create file:%s\n",error->message);
g_error_free(error);
}
else
converted_line = g_strconcat(pre_key[0], ">", key_name, "<", post_key[1], "\n", NULL);
g_io_channel_write_chars(channel, converted_line, -1, NULL, &error);
- if (error) {DEBUG_0("Keyboard Map:%s\n",error->message); g_error_free(error);}
+ if (error) {log_printf("Warning: Keyboard Map:%s\n",error->message); g_error_free(error);}
g_free(converted_line);
g_strfreev(pre_key);
else
{
g_io_channel_write_chars(channel, keymap_template[keymap_index], -1, NULL, &error);
- if (error) {DEBUG_0("Keyboard Map:%s\n",error->message); g_error_free(error);}
+ if (error) {log_printf("Warning: Keyboard Map:%s\n",error->message); g_error_free(error);}
g_io_channel_write_chars(channel, "\n", -1, NULL, &error);
- if (error) {DEBUG_0("Keyboard Map:%s\n",error->message); g_error_free(error);}
+ if (error) {log_printf("Warning: Keyboard Map:%s\n",error->message); g_error_free(error);}
}
keymap_index++;
}
g_io_channel_flush(channel, &error);
- if (error) {DEBUG_0("Keyboard Map:%s\n",error->message); g_error_free(error);}
+ if (error) {log_printf("Warning: Keyboard Map:%s\n",error->message); g_error_free(error);}
g_io_channel_unref(channel);
index=0;
#ifdef HAVE_CLUTTER
return renderer_clutter_new(pr);
#else
- DEBUG_0("Geeqie is built without clutter renderer support");
+ log_printf("Warning: Geeqie is built without clutter renderer support");
#endif
}
return renderer_tiles_new(pr);
{
c_options->thumbnails.spec_standard =FALSE;
}
- DEBUG_0("standard %d",c_options->thumbnails.spec_standard);
}
static void cache_geeqie_cb(GtkWidget *widget, gpointer data)
{
c_options->thumbnails.spec_standard =FALSE;
}
- DEBUG_0("geeqie %d",c_options->thumbnails.spec_standard);
}
static void cache_local_cb(GtkWidget *widget, gpointer data)
);
cogl_shader_compile(shader);
gchar *err = cogl_shader_get_info_log(shader);
- DEBUG_0("%s\n",err);
+ DEBUG_3("%s\n",err);
g_free(err);
program = cogl_create_program ();
CoglHandle material;
CoglHandle tex3d;
- DEBUG_0("%s clut start", get_exec_time());
+ DEBUG_3("%s clut start", get_exec_time());
for (r = 0; r < CLUT_SIZE; r++)
{
}
g_object_unref(tmp_pixbuf);
- DEBUG_0("%s clut upload start", get_exec_time());
+ DEBUG_3("%s clut upload start", get_exec_time());
#if COGL_VERSION_CHECK(1,18,2)
{
CoglContext *ctx = clutter_backend_get_cogl_context(clutter_get_default_backend ());
material = clutter_texture_get_cogl_material(CLUTTER_TEXTURE(rc->texture));
cogl_material_set_layer(material, 1, tex3d);
cogl_handle_unref(tex3d);
- DEBUG_0("%s clut end", get_exec_time());
+ DEBUG_3("%s clut end", get_exec_time());
rc->clut_updated = TRUE;
}
clutter_actor_set_anchor_point(CLUTTER_ACTOR(rc->texture), 0, 0);
- DEBUG_0("scale %d %d", rc->pr->width, rc->pr->height);
- DEBUG_0("pos %d %d", rc->pr->x_offset, rc->pr->y_offset);
+ DEBUG_3("scale %d %d", rc->pr->width, rc->pr->height);
+ DEBUG_3("pos %d %d", rc->pr->x_offset, rc->pr->y_offset);
clutter_actor_set_scale(CLUTTER_ACTOR(rc->texture),
(gfloat)pr->width / pr->image_width,
{
/* delay clutter redraw until the texture has some data
set priority between gtk redraw and clutter redraw */
- DEBUG_0("%s tex upload high prio", get_exec_time());
+ DEBUG_3("%s tex upload high prio", get_exec_time());
rc->idle_update = g_idle_add_full(CLUTTER_PRIORITY_REDRAW - 10, rc_area_changed_cb, rc, NULL);
}
else
{
/* higher prio than histogram */
- DEBUG_0("%s tex upload low prio", get_exec_time());
+ DEBUG_3("%s tex upload low prio", get_exec_time());
rc->idle_update = g_idle_add_full(G_PRIORITY_DEFAULT_IDLE - 5, rc_area_changed_cb, rc, NULL);
}
if (h > par->h) h = par->h;
- DEBUG_0("%s upload start", get_exec_time());
+ DEBUG_3("%s upload start", get_exec_time());
if (pr->pixbuf)
{
CoglHandle texture = clutter_texture_get_cogl_texture(CLUTTER_TEXTURE(rc->texture));
gdk_pixbuf_get_rowstride(pr->pixbuf),
gdk_pixbuf_get_pixels(pr->pixbuf));
}
- DEBUG_0("%s upload end", get_exec_time());
+ DEBUG_3("%s upload end", get_exec_time());
rc_area_clip_add(rc, par->x, par->y, par->w, h);
RendererClutter *rc = (RendererClutter *)renderer;
PixbufRenderer *pr = rc->pr;
- DEBUG_0("rc_update_pixbuf");
+ DEBUG_3("rc_update_pixbuf");
rc_remove_pending_updates(rc);
rc->last_pixbuf_change = g_get_monotonic_time();
- DEBUG_0("%s change time reset", get_exec_time());
+ DEBUG_3("%s change time reset", get_exec_time());
if (pr->pixbuf)
{
gint width = gdk_pixbuf_get_width(pr->pixbuf);
gint height = gdk_pixbuf_get_height(pr->pixbuf);
- DEBUG_0("pixbuf size %d x %d (%d)", width, height, gdk_pixbuf_get_has_alpha(pr->pixbuf) ? 32 : 24);
+ DEBUG_3("pixbuf size %d x %d (%d)", width, height, gdk_pixbuf_get_has_alpha(pr->pixbuf) ? 32 : 24);
gint prev_width, prev_height;
{
RendererClutter *rc = (RendererClutter *)renderer;
- DEBUG_0("rc_update_zoom");
+ DEBUG_3("rc_update_zoom");
rc_sync_actor(rc);
}
rc->stereo_off_y = rc->pr->stereo_fixed_y_left;
}
}
- DEBUG_0("rc_update_viewport scale %d %d", rc->pr->width, rc->pr->height);
+ DEBUG_3("rc_update_viewport scale %d %d", rc->pr->width, rc->pr->height);
clutter_stage_set_color(CLUTTER_STAGE(rc->stage), &stage_color);
static void rc_scroll(void *renderer, gint x_off, gint y_off)
{
- DEBUG_0("rc_scroll");
+ DEBUG_3("rc_scroll");
RendererClutter *rc = (RendererClutter *)renderer;
rc_sync_actor(rc);
if (!GTK_CLUTTER_IS_EMBED(rc->widget))
{
g_free(rc);
- DEBUG_0("pixbuf renderer has a child of other type than gtk_clutter_embed");
+ DEBUG_3("pixbuf renderer has a child of other type than gtk_clutter_embed");
return NULL;
}
}
ds->spin_y = pref_spin_new(ds->box, NULL, NULL, 1900, 9999, 1, 0, 1900, NULL, NULL);
break;
default:
- DEBUG_0("Date locale %s is unknown", date_format);
+ log_printf("Warning: Date locale %s is unknown", date_format);
break;
}
}