After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 703231 - [examples] Added SoupLogger to get example
[examples] Added SoupLogger to get example
Status: RESOLVED FIXED
Product: libsoup
Classification: Core
Component: Misc
unspecified
Other All
: Normal enhancement
: ---
Assigned To: libsoup-maint@gnome.bugs
libsoup-maint@gnome.bugs
Depends on:
Blocks:
 
 
Reported: 2013-06-28 09:36 UTC by Andres Gomez
Modified: 2013-07-03 07:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[examples] Added SoupLogger to get example (4.61 KB, patch)
2013-06-28 09:36 UTC, Andres Gomez
reviewed Details | Review
[examples] Added SoupLogger to get example (3.31 KB, patch)
2013-07-02 16:24 UTC, Andres Gomez
accepted-commit_now Details | Review

Description Andres Gomez 2013-06-28 09:36:46 UTC
Now, instead of printing the debug information
manually we use SoupLogger for this with the "-d"
flag.

Notice that we keep also the manual printing when
using just the "-h" flag since this is an example
and we want to show how to iterate over the
message headers.
Comment 1 Andres Gomez 2013-06-28 09:36:48 UTC
Created attachment 247959 [details] [review]
[examples] Added SoupLogger to get example

Now, instead of printing the debug information
manually we use SoupLogger for this with the "-d"
flag.

Notice that we keep also the manual printing when
using just the "-h" flag since this is an example
and we want to show how to iterate over the
message headers.
Comment 2 Dan Winship 2013-06-29 16:56:30 UTC
Comment on attachment 247959 [details] [review]
[examples] Added SoupLogger to get example

> Notice that we keep also the manual printing when
> using just the "-h" flag since this is an example
> and we want to show how to iterate over the
> message headers.

Nah, just use SoupLogger always. In general, we want the examples to show the *right* way to do things, or people will copy the wrong ways. :)

(And simple-proxy shows how to iterate headers too anyway.)

> static void
>+log_printer (SoupLogger *logger, SoupLoggerLogLevel level, char direction, const char *data, gpointer user_data)
>+{
>+	g_print ("Network LOG: %c %s\n", direction, data);
>+}

I don't think we really need that. Just use the default printer.
Comment 3 Andres Gomez 2013-07-02 16:18:34 UTC
(In reply to comment #2)
> Nah, just use SoupLogger always. In general, we want the examples to show the
> *right* way to do things, or people will copy the wrong ways. :)
> 
> (And simple-proxy shows how to iterate headers too anyway.)

OK.

> I don't think we really need that. Just use the default printer.

OK.
Comment 4 Andres Gomez 2013-07-02 16:24:14 UTC
Created attachment 248245 [details] [review]
[examples] Added SoupLogger to get example

Now, instead of printing the debug information
manually we use SoupLogger for this with the "-d"
flag.
Comment 5 Andres Gomez 2013-07-03 07:54:23 UTC
Pushed to master