Odd problem

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Odd problem

Paul Thompson
I am working on a script recorder for gimp. I am writing out debug
statements to attempt to learn this and that. The problem is that debug
statements in some files print as expected, while the same statement placed
into other files do not print to the calling window.

I am working on a windows system, and have followed the direction in

https://wiki.gimp.org/wiki/Hacking:Building/Windows

These are well-written directions, and enable me to compile a running copy.
So far so good.

I am working with 2 files:

File 1:
gimp/libgimp/gimpimagemetadata.c

All statements put into this file, such as

      g_print("Test 1 - add new print statement\n");

print as directed to the window

File 2:
gimp/app/file/file-open.c

Statements put into this file, including a copy of the statement above, do
not print, regardless of what printing function I use.

I know that  I am going through the relevant section since I open and write
to a file successfully in the section that I have the g_print statement.

The compile is clean, although there are libtool warnings.

Is there some overlooked flag which turns printing on and off in specific
functions that I am unaware of? This is creating difficulties in my
progress.

Paul A. Thompson
_______________________________________________
gimp-developer-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Odd problem

Bill Skaggs
Let me quote from the glib documentation for g_print():  Outputs a
formatted message via the print handler. The default print handler simply
outputs the message to stdout. g_print()
<https://people.gnome.org/%7Edesrt/glib-docs/glib-Warnings-and-Assertions.html#g-print>
should not be used from within libraries for debugging messages, since it
may be redirected by applications to special purpose message windows or
even files. Instead, libraries should use g_log()
<https://people.gnome.org/%7Edesrt/glib-docs/glib-Message-Logging.html#g-log>,
or the convenience functions g_message()
<https://people.gnome.org/%7Edesrt/glib-docs/glib-Message-Logging.html#g-message>,
g_warning()
<https://people.gnome.org/%7Edesrt/glib-docs/glib-Message-Logging.html#g-warning>
and g_error()
<https://people.gnome.org/%7Edesrt/glib-docs/glib-Message-Logging.html#g-error>
.



On Fri, Jul 7, 2017 at 1:55 PM, Paul Thompson <[hidden email]> wrote:

> I am working on a script recorder for gimp. I am writing out debug
> statements to attempt to learn this and that. The problem is that debug
> statements in some files print as expected, while the same statement placed
> into other files do not print to the calling window.
>
> I am working on a windows system, and have followed the direction in
>
> https://wiki.gimp.org/wiki/Hacking:Building/Windows
>
> These are well-written directions, and enable me to compile a running copy.
> So far so good.
>
> I am working with 2 files:
>
> File 1:
> gimp/libgimp/gimpimagemetadata.c
>
> All statements put into this file, such as
>
>       g_print("Test 1 - add new print statement\n");
>
> print as directed to the window
>
> File 2:
> gimp/app/file/file-open.c
>
> Statements put into this file, including a copy of the statement above, do
> not print, regardless of what printing function I use.
>
> I know that  I am going through the relevant section since I open and write
> to a file successfully in the section that I have the g_print statement.
>
> The compile is clean, although there are libtool warnings.
>
> Is there some overlooked flag which turns printing on and off in specific
> functions that I am unaware of? This is creating difficulties in my
> progress.
>
> Paul A. Thompson
> _______________________________________________
> gimp-developer-list mailing list
> List address:    [hidden email]
> List membership: https://mail.gnome.org/mailman/listinfo/gimp-
> developer-list
> List archives:   https://mail.gnome.org/archives/gimp-developer-list
>
_______________________________________________
gimp-developer-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Odd problem

Partha Bagchi-2
In reply to this post by Paul Thompson
On Fri, Jul 7, 2017 at 4:55 PM, Paul Thompson <[hidden email]> wrote:

> I am working on a script recorder for gimp. I am writing out debug
> statements to attempt to learn this and that. The problem is that debug
> statements in some files print as expected, while the same statement placed
> into other files do not print to the calling window.
>
> I am working on a windows system, and have followed the direction in
>
> https://wiki.gimp.org/wiki/Hacking:Building/Windows
>
> These are well-written directions, and enable me to compile a running copy.
> So far so good.
>
> I am working with 2 files:
>
> File 1:
> gimp/libgimp/gimpimagemetadata.c
>
> All statements put into this file, such as
>
>       g_print("Test 1 - add new print statement\n");
>
> print as directed to the window
>
> File 2:
> gimp/app/file/file-open.c
>
> Statements put into this file, including a copy of the statement above, do
> not print, regardless of what printing function I use.
>
> I know that  I am going through the relevant section since I open and write
> to a file successfully in the section that I have the g_print statement.
>
> The compile is clean, although there are libtool warnings.
>
> Is there some overlooked flag which turns printing on and off in specific
> functions that I am unaware of? This is creating difficulties in my
> progress.
>
> Paul A. Thompson
>
> Paul,

You should be able to access gimp_message and friends and use those
functions to print messages to the error console.
_______________________________________________
gimp-developer-list mailing list
List address:    [hidden email]
List membership: https://mail.gnome.org/mailman/listinfo/gimp-developer-list
List archives:   https://mail.gnome.org/archives/gimp-developer-list
Loading...