[Spice-devel] [vdagent-linux v2 3/6] console-kit: save verbosity level for debugging

Victor Toso victortoso at redhat.com
Thu Apr 28 11:23:50 UTC 2016


Hi,

On Wed, Apr 27, 2016 at 02:41:36PM -0500, Jonathon Jongsma wrote:
> It appears that the systemd implementation of session-info uses LOG_INFO instead
> of LOG_DEBUG. Probably best to be consistent.
>
> Reviewed-by: Jonathon Jongsma <jjongsma at redhat.com>

I didn't pay much attention to this, thank you.  Overall, I think about
'info' as something that software wants to always output as additional
information, something like "using console-kit" or "using systemd" and
"debug" as extra/verbose information in order to track issues.

I'm not sure if we want to keep consistency with systemd here or we want
to fix the log-levels there instead (if my logic above is correct).

I'll send a new series today, I'll double-check all logs to see if
'info' could fit better then 'debug' (again, with my logic above)

Cheers,
  toso
>
>
> On Sat, 2016-04-23 at 12:27 +0200, Victor Toso wrote:
> > ---
> >  src/console-kit.c | 9 +++++++++
> >  1 file changed, 9 insertions(+)
> > 
> > diff --git a/src/console-kit.c b/src/console-kit.c
> > index c45f662..fc73cf2 100644
> > --- a/src/console-kit.c
> > +++ b/src/console-kit.c
> > @@ -32,6 +32,7 @@ struct session_info {
> >      int fd;
> >      char *seat;
> >      char *active_session;
> > +    int verbose;
> >  };
> >  
> >  #define INTERFACE_CONSOLE_KIT "org.freedesktop.ConsoleKit"
> > @@ -55,6 +56,8 @@ struct session_info *session_info_create(int verbose)
> >      if (!si)
> >          return NULL;
> >  
> > +    si->verbose = verbose;
> > +
> >      dbus_error_init(&error);
> >      si->connection = dbus_bus_get_private(DBUS_BUS_SYSTEM, &error);
> >      if (si->connection == NULL || dbus_error_is_set(&error)) {
> > @@ -172,6 +175,8 @@ exit:
> >              dbus_message_unref(message);
> >      }
> >  
> > +    if (si->verbose)
> > +        syslog(LOG_DEBUG, "(console-kit) seat: %s", si->seat);
> >      return si->seat;
> >  }
> >  
> > @@ -360,5 +365,9 @@ static char
> > *console_kit_check_active_session_change(struct session_info *si)
> >          dbus_connection_read_write(si->connection, 0);
> >      }
> >  
> > +    if (si->verbose)
> > +        syslog(LOG_DEBUG, "(console-kit) active-session: '%s'",
> > +               (si->active_session ? si->active_session : "None"));
> > +
> >      return si->active_session;
> >  }


More information about the Spice-devel mailing list