For debugging sake, log to stderr / stdout. A modern system will redirect
stderr to something like the systemd journal for structured logging
appropriately.


On Sat, May 4, 2013 at 12:46 PM, אנטולי קרסנר <tomback...@gmail.com> wrote:

> Thanks for your reply,
>
> I realized app error logs are needed only for debugging, I guess that's
> why release-build apps in general don't need to log anything. In debug
> mode, I'm taking your advice to write to the standard home cache dir.
>
> Anatoly
>
> On א', 2013-05-05 at 01:16 +0900, Tristan Van Berkom wrote:
> > On Sat, May 4, 2013 at 10:22 PM, אנטולי קרסנר <tomback...@gmail.com>
> wrote:
> > > Hello,
> > >
> > > I'm writing a desktop application using Gnome technologies. I added
> > > support for some operations which may fail or produce useful errors, so
> > > I decided I want the app to record the warnings and errors in a log
> > > file, allowing me to see the report later, and find bugs.
> > >
> > > I tried to find any conventions for GNU software logging, and for Gnome
> > > apps, but I found nothing.
> > >
> > > Is there a convention for that? A standard location for log files in
> > > filesystem/home directory? A common standard for naming them and
> filling
> > > the contents?
> >
> > System daemons would generally dump logs somewhere like:
> >     $(localstatedir)/log/$(daemonname)/$(daemonname).log
> >
> > Apps don't really log AFAIK, as they don't really have write permissions
> > to /var/log, instead I would think it more appropriate for the app
> launcher
> > (something integrated in the window manager, like a springboard) to
> direct
> > logging of an apps' stdout/stderr to some directory *it* controls
> (however
> > I don't know if WMs or gnome-shell actually do this, just think it would
> > be the 'right way').
> >
> > If your app must write somewhere, it would be safe to write in
> XDG_CACHE_HOME
> > (g_get_user_cache_dir()).
> >
> > Cheers,
> >     -Tristan
> >
> > >
> > > And does Gnome have a log viewer app for reading log files produced by
> > > applications?
> > >
> > >
> > > Anatoly
> > >
> > > _______________________________________________
> > > gtk-list mailing list
> > > gtk-list@gnome.org
> > > https://mail.gnome.org/mailman/listinfo/gtk-list
>
>
> _______________________________________________
> gtk-list mailing list
> gtk-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-list
>



-- 
  Jasper
_______________________________________________
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list

Reply via email to