elementary-dev-community team mailing list archive
Mailing list archive
Re: Granite Logger
I suppose notification() and g_message() doesn't print exactly the same
thing, there is several log level:
So I suppose INFO = g_message.
There is a default display level for the Logger
(Granite.Services.Logger.DIsplayLevel), by default it is set to
LogLevel.WARN, so, you have to change it if you want to print debug
On 08/14/2011 06:44 PM, Avi Romanoff wrote:
In that case, why should logger.notification() exist when I should
just be able to use g_message()?
But actually, message(), logger.notification(), and debug() do
*not* print to terminal. I tested all of the logging convenience
functions I could find and threw this into my code:
var logger = new Granite.Services.Logger ();
Which when run results in:
[L_WARN 12:38:53.392668] [switchboard-app:354] warning();
[L_FATAL 12:38:53.392936] [switchboard-app:356] crticial();
[L_FATAL 12:38:53.393048] Switchboard will not function properly.
So only 2 of the 5 logging functions, including the one in Logger
itself, didn't work.
Am I doing something wrong, or is this a bug?
On Sun, Aug 14, 2011 at 5:27 AM, Lucas Baudin <xapantu@xxxxxxxxx
I don't have the time to write a long mail atm, but in fact, you
must call g_debug (or debug() in vala), g_warning, g_critical,
etc... to log any informations using the Granite logger. It will
just replace the default glib formatter, but you must use the same
On 08/14/2011 08:26 AM, Avi Romanoff wrote:
I am in the process of giving Switchboard as much Granite love as
I can before the imminent 1.0 launch. I believe the way logging
works in Granite right now is pretty broken.
First off, the only logging function Logger actually provides is
notification(), which does not even appear to print any message
in my test. Obviously it should work, and I'll file a bug, but
what about other log levels? Surely it would make just as much
sense to have convenience functions for critical/fatal and
debugging errors as well?
Additionally it seems to me that Logger being something of a
singleton makes it massively annoying to log errors in different
parts of an application, where access to the Logger object might
not be available. Could/should the logging system
be re-factored to accommodate this, or am I missing something?
Mailing list: https://launchpad.net/~elementary-dev-community
Post to : elementary-dev-community@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~elementary-dev-community
More help : https://help.launchpad.net/ListHelp