Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove most uses of stdout for debug, etc. #49. #65

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions libglabels/lgl-db.c
Original file line number Diff line number Diff line change
Expand Up @@ -744,15 +744,15 @@ lgl_db_print_known_papers (void)
lgl_db_init ();
}

g_print ("%s():\n", __FUNCTION__);
fprintf (stderr, "%s():\n", __FUNCTION__);
for (p = model->papers; p != NULL; p = p->next)
{
paper = (lglPaper *) p->data;

g_print ("PAPER id=\"%s\", name=\"%s\", width=%gpts, height=%gpts\n",
fprintf (stderr, "PAPER id=\"%s\", name=\"%s\", width=%gpts, height=%gpts\n",
paper->id, paper->name, paper->width, paper->height);
}
g_print ("\n");
fprintf (stderr, "\n");

}

Expand Down Expand Up @@ -1143,14 +1143,14 @@ lgl_db_print_known_categories (void)
lgl_db_init ();
}

g_print ("%s():\n", __FUNCTION__);
fprintf (stderr, "%s():\n", __FUNCTION__);
for (p = model->categories; p != NULL; p = p->next)
{
category = (lglCategory *) p->data;

g_print ("CATEGORY id=\"%s\", name=\"%s\"\n", category->id, category->name);
fprintf (stderr, "CATEGORY id=\"%s\", name=\"%s\"\n", category->id, category->name);
}
g_print ("\n");
fprintf (stderr, "\n");

}

Expand Down Expand Up @@ -1384,15 +1384,15 @@ lgl_db_print_known_vendors (void)
lgl_db_init ();
}

g_print ("%s():\n", __FUNCTION__);
fprintf (stderr, "%s():\n", __FUNCTION__);
for (p = model->vendors; p != NULL; p = p->next)
{
vendor = (lglVendor *) p->data;

g_print ("VENDOR name=\"%s\", url=\"%s\"\n",
fprintf (stderr, "VENDOR name=\"%s\", url=\"%s\"\n",
vendor->name, vendor->url);
}
g_print ("\n");
fprintf (stderr, "\n");

}

Expand Down Expand Up @@ -2097,16 +2097,16 @@ lgl_db_print_known_templates (void)
lgl_db_init ();
}

g_print ("%s():\n", __FUNCTION__);
fprintf (stderr, "%s():\n", __FUNCTION__);
for (p=model->templates; p!=NULL; p=p->next)
{
template = (lglTemplate *)p->data;

g_print("TEMPLATE brand=\"%s\", part=\"%s\", description=\"%s\"\n",
fprintf (stderr, "TEMPLATE brand=\"%s\", part=\"%s\", description=\"%s\"\n",
template->brand, template->part, template->description);

}
g_print ("\n");
fprintf (stderr, "\n");

}

Expand Down
9 changes: 5 additions & 4 deletions libglabels/lgl-template.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <math.h>
#include <stdio.h>

#include "libglabels-private.h"

Expand Down Expand Up @@ -1414,15 +1415,15 @@ compare_origins (gconstpointer a,
void
lgl_template_print (const lglTemplate *template)
{
g_print ("---- %s( TEMPLATE=%p ) ----\n", __FUNCTION__, template);
fprintf (stderr, "---- %s( TEMPLATE=%p ) ----\n", __FUNCTION__, template);

g_print("brand=\"%s\", part=\"%s\", description=\"%s\"\n",
fprintf (stderr, "brand=\"%s\", part=\"%s\", description=\"%s\"\n",
template->brand, template->part, template->description);

g_print("paper_id=\"%s\", page_width=%g, page_height=%g\n",
fprintf (stderr, "paper_id=\"%s\", page_width=%g, page_height=%g\n",
template->paper_id, template->page_width, template->page_height);

g_print ("\n");
fprintf (stderr, "\n");

}

Expand Down
5 changes: 3 additions & 2 deletions libglbarcode/lgl-barcode-onecode.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <glib.h>
#include <ctype.h>
#include <string.h>
#include <stdio.h>

/*========================================================*/
/* Private macros and constants. */
Expand Down Expand Up @@ -666,9 +667,9 @@ int104_print (Int104 *x)

for ( i = 0; i < 13; i++ )
{
g_print ("%02x ", x->byte[i] & 0xFF);
fprintf (stderr, "%02x ", x->byte[i] & 0xFF);
}
g_print ("\n");
fprintf (stderr, "\n");
}
#endif

Expand Down
2 changes: 1 addition & 1 deletion src/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ gl_debug (glDebugSection section,
msg = g_strdup_vprintf (format, args);
va_end (args);

g_print ("%s:%d (%s) %s\n", file, line, function, msg);
g_debug ("%s:%d (%s) %s\n", file, line, function, msg);

g_free (msg);
}
Expand Down
6 changes: 4 additions & 2 deletions src/glabels-batch.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <glib/gi18n.h>

#include <math.h>
#include <stdio.h>

#include <libglabels.h>
#include "merge-init.h"
Expand Down Expand Up @@ -104,7 +105,7 @@ main (int argc, char **argv)
gtk_parse_args (&argc, &argv);
if (!g_option_context_parse (option_context, &argc, &argv, &error))
{
g_print(_("%s\nRun '%s --help' to see a full list of available command line options.\n"),
fprintf (stderr, _("%s\nRun '%s --help' to see a full list of available command line options.\n"),
error->message, argv[0]);
g_error_free (error);
return 1;
Expand Down Expand Up @@ -135,7 +136,8 @@ main (int argc, char **argv)

/* now print the files */
for (p = file_list; p; p = p->next) {
g_print ("LABEL FILE = %s\n", (gchar *) p->data);
fprintf (stderr, "LABEL FILE = %s\n", (gchar *) p->data);

label = gl_xml_label_open (p->data, &status);


Expand Down
2 changes: 1 addition & 1 deletion src/label-properties-dialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ gl_label_properties_dialog_response_cb (glLabelPropertiesDialog *dialog,
gtk_widget_hide (GTK_WIDGET (dialog));
break;
default:
g_print ("response = %d", response);
g_error ("response = %d", response);
g_assert_not_reached ();
}

Expand Down
5 changes: 3 additions & 2 deletions src/label-text.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <pango/pango.h>
#include <math.h>
#include <string.h>
#include <stdio.h>

#include "font-util.h"
#include "font-history.h"
Expand Down Expand Up @@ -1059,8 +1060,8 @@ auto_shrink_font_size (cairo_t *cr,

g_object_unref (layout);

g_print ("Object w = %g, layout w = %g\n", width, layout_width);
g_print ("Object h = %g, layout h = %g\n", height, layout_height);
fprintf (stderr, "Object w = %g, layout w = %g\n", width, layout_width);
fprintf (stderr, "Object h = %g, layout h = %g\n", height, layout_height);

new_wsize = new_hsize = size;
if ( layout_width > width )
Expand Down
2 changes: 1 addition & 1 deletion src/media-select.c
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,7 @@ gl_media_select_get_name (glMediaSelect *this)
}
else
{
g_print ("notebook page = %d\n", page_num);
g_error ("notebook page = %d\n", page_num);
g_assert_not_reached ();
}

Expand Down
2 changes: 1 addition & 1 deletion src/merge-properties-dialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ response_cb (glMergePropertiesDialog *dialog,
case GTK_RESPONSE_DELETE_EVENT:
break;
default:
g_print ("response = %d", response);
g_error ("response = %d", response);
g_assert_not_reached ();
}

Expand Down
2 changes: 1 addition & 1 deletion src/prefs-dialog.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ response_cb (glPrefsDialog *dialog,
case GTK_RESPONSE_DELETE_EVENT:
break;
default:
g_print ("response = %d", response);
g_error ("response = %d", response);
g_assert_not_reached ();
}

Expand Down
3 changes: 2 additions & 1 deletion src/text-node.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "text-node.h"

#include <string.h>
#include <stdio.h>

#include "merge.h"

Expand Down Expand Up @@ -356,7 +357,7 @@ gl_text_node_lines_print (GList * lines )
for (p_node = (GList *) p_line->data, i_node=0; p_node != NULL;
p_node = p_node->next, i_node++) {
text_node = (glTextNode *) p_node->data;
g_print( "LINE[%d], NODE[%d] = { %d, \"%s\" }\n",
fprintf (stderr, "LINE[%d], NODE[%d] = { %d, \"%s\" }\n",
i_line, i_node,
text_node->field_flag, text_node->data );

Expand Down
4 changes: 2 additions & 2 deletions src/view.c
Original file line number Diff line number Diff line change
Expand Up @@ -2154,7 +2154,7 @@ resize_event (glView *view,
break;

default:
g_print ("Invalid handle.\n"); /* Should not happen! */
g_warning ("Invalid handle.\n"); /* Should not happen! */

}

Expand Down Expand Up @@ -2198,7 +2198,7 @@ resize_event (glView *view,
break;

default:
g_print ("Invalid handle.\n"); /* Should not happen! */
g_warning ("Invalid handle.\n"); /* Should not happen! */
}
}
else
Expand Down