Re: GNOME plans



> Possible End user TODO:
> . Find & report bugs.
> . Write documentation
>
> Possible Developer TODO:
> . Fix bugs.
> . Write documentation.

Here's a patch for gmessages.c in GLIB so that it will print out the program
name everytime it prints a warning. I find it annoying whenever I return to
a virtual terminal after closing X down to find 4 or 5 **Warning** Cannot
disconnect signal handler 108465638 or some such warnings, without knowing
where they've come from (I had originally thought GMC, turns out it'd the
panel - thanks to the patch :). It's probably already available in a
configuration option somewhere but that would have involved RTFM and I
didn't, so I don't know.
I've waffled enough, here's the patch
Hope it's useful.
Iain
--- /usr/local/src/gnome/glib/gmessages.c Sat Jul 31 13:25:52 1999
+++ /home/iain/gmessages.c Sat Jul 31 13:46:45 1999
@@ -424,8 +424,10 @@
   GWarningFunc   local_glib_warning_func;
   GPrintFunc     local_glib_message_func;
+  gchar *prgname;

   in_recursion = (log_level & G_LOG_FLAG_RECURSION) != 0;
   is_fatal = (log_level & G_LOG_FLAG_FATAL) != 0;
   log_level &= G_LOG_LEVEL_MASK;
+  prgname = g_get_prgname ();

   if (!message)
@@ -461,4 +463,6 @@
  {
    write (fd, "\n", 1);
+   write (fd, prgname, strlen (prgname));
+   write (fd, ": ", 2);
    write (fd, log_domain, strlen (log_domain));
    write (fd, "-", 1);
@@ -481,4 +485,6 @@
  {
    write (fd, "\n", 1);
+   write (fd, prgname, strlen (prgname));
+   write (fd, ": ", 2);
    write (fd, log_domain, strlen (log_domain));
    write (fd, "-", 1);
@@ -507,4 +513,6 @@
  {
    write (fd, "\n", 1);
+   write (fd, prgname, strlen (prgname));
+   write (fd, ": ", 2);
    write (fd, log_domain, strlen (log_domain));
    write (fd, "-", 1);
@@ -532,4 +540,6 @@
       if (log_domain)
  {
+   write (fd, prgname, strlen (prgname));
+   write (fd, ": ", 2);
    write (fd, log_domain, strlen (log_domain));
    write (fd, "-", 1);
@@ -549,4 +559,6 @@
       if (log_domain)
  {
+   write (fd, prgname, strlen (prgname));
+   write (fd, ": ", 2);
    write (fd, log_domain, strlen (log_domain));
    write (fd, "-", 1);
@@ -566,4 +578,6 @@
       if (log_domain)
  {
+   write (fd, prgname, strlen (prgname));
+   write (fd, ": ", 2);
    write (fd, log_domain, strlen (log_domain));
    write (fd, "-", 1);

gmessages.c.patch



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]