[PATCH weston] desktop-shell: better error logging

Siddharth Heroor heroor at gmail.com
Mon Apr 15 01:23:35 PDT 2013


On Sat, Apr 13, 2013 at 1:15 PM, Philipp Brüschweiler <blei42 at gmail.com>wrote:

> ---
>  clients/desktop-shell.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c
> index 41e7daa..ce2366d 100644
> --- a/clients/desktop-shell.c
> +++ b/clients/desktop-shell.c
> @@ -524,8 +524,10 @@ load_icon_or_fallback(const char *icon)
>         if (cairo_surface_status(surface) == CAIRO_STATUS_SUCCESS)
>                 return surface;
>
> +       fprintf(stderr, "ERROR loading icon from file '%s', error: '%s'\n",
> +               icon,
> +               cairo_status_to_string(cairo_surface_status(surface)));
>

Instead of calling cairo_surface_status twice, you could save the return
value from above, use it for success check and then print the error.


>         cairo_surface_destroy(surface);
> -       fprintf(stderr, "ERROR loading icon from file '%s'\n", icon);
>
>         /* draw fallback icon */
>         surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
> --
>
1.8.2.1
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>


-- 
Sid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20130415/7da27593/attachment-0001.html>


More information about the wayland-devel mailing list