Re: [Spice-devel] spice-server, logging and style

2015-11-25 Thread Jonathon Jongsma
On Tue, 2015-11-24 at 06:20 -0500, Frediano Ziglio wrote: > > > > On Mon, Nov 23, 2015 at 12:28:49PM -0500, Frediano Ziglio wrote: > > > > Maybe you are suggesting more or less the same thing :). > > > > To me, from worst to "less worse", when something unexpected happens: > > > > - not detected,

Re: [Spice-devel] spice-server, logging and style

2015-11-24 Thread Frediano Ziglio
> > On Mon, Nov 23, 2015 at 12:28:49PM -0500, Frediano Ziglio wrote: > > > Maybe you are suggesting more or less the same thing :). > > > To me, from worst to "less worse", when something unexpected happens: > > > - not detected, code continues running but behaves unpredictably (can > > > easily

Re: [Spice-devel] spice-server, logging and style

2015-11-24 Thread Christophe Fergeau
On Mon, Nov 23, 2015 at 12:28:49PM -0500, Frediano Ziglio wrote: > > Maybe you are suggesting more or less the same thing :). > > To me, from worst to "less worse", when something unexpected happens: > > - not detected, code continues running but behaves unpredictably (can > > easily lead to a se

Re: [Spice-devel] spice-server, logging and style

2015-11-23 Thread Frediano Ziglio
> Hi, > > On Fri, Nov 20, 2015 at 01:12:27PM -0500, Frediano Ziglio wrote: > > assert (the base C) abort on condition failed and can be compiled out. > > Somebody > > by default disable these checks on release (I call it the Windows style) > > while > > other prefer to never disable (I call the Un

Re: [Spice-devel] spice-server, logging and style

2015-11-23 Thread Christophe Fergeau
Hi, On Fri, Nov 20, 2015 at 01:12:27PM -0500, Frediano Ziglio wrote: > assert (the base C) abort on condition failed and can be compiled out. > Somebody > by default disable these checks on release (I call it the Windows style) while > other prefer to never disable (I call the Unix style). If dis

Re: [Spice-devel] spice-server, logging and style

2015-11-23 Thread Christophe Fergeau
On Fri, Nov 20, 2015 at 01:14:20PM -0500, Marc-André Lureau wrote: > Hi > > - Original Message - > > On Fri, Nov 20, 2015 at 01:01:30PM -0500, Frediano Ziglio wrote: > > > > > > > > On Tue, Nov 03, 2015 at 08:15:14AM -0500, Frediano Ziglio wrote: > > > > > Problems: > > > > > - the Spice_

Re: [Spice-devel] spice-server, logging and style

2015-11-20 Thread Marc-André Lureau
Hi - Original Message - > On Fri, Nov 20, 2015 at 01:01:30PM -0500, Frediano Ziglio wrote: > > > > > > On Tue, Nov 03, 2015 at 08:15:14AM -0500, Frediano Ziglio wrote: > > > > Problems: > > > > - the Spice_style.odt is outdated; > > > > - spice_assert recall the standard assert but instea

Re: [Spice-devel] spice-server, logging and style

2015-11-20 Thread Frediano Ziglio
> > Hey, > > So there has been quite some discussions about logging. > > To sum up my personal thoughts on this: > > - we should just switch to using glib for logging. This means some mass > renaming will need to be done at some point. Maybe it's possible to do > it on the whole refactoring

Re: [Spice-devel] spice-server, logging and style

2015-11-20 Thread Christophe Fergeau
On Fri, Nov 20, 2015 at 01:01:30PM -0500, Frediano Ziglio wrote: > > > > On Tue, Nov 03, 2015 at 08:15:14AM -0500, Frediano Ziglio wrote: > > > Problems: > > > - the Spice_style.odt is outdated; > > > - spice_assert recall the standard assert but instead it mainly > > > call spice_error which li

Re: [Spice-devel] spice-server, logging and style

2015-11-20 Thread Frediano Ziglio
> > On Tue, Nov 03, 2015 at 08:15:14AM -0500, Frediano Ziglio wrote: > > Problems: > > - the Spice_style.odt is outdated; > > - spice_assert recall the standard assert but instead it mainly > > call spice_error which like GLib is fatal and should call exit/abort. > > It is not affected by NDEB

Re: [Spice-devel] spice-server, logging and style

2015-11-20 Thread Christophe Fergeau
Hey, So there has been quite some discussions about logging. To sum up my personal thoughts on this: - we should just switch to using glib for logging. This means some mass renaming will need to be done at some point. Maybe it's possible to do it on the whole refactoring branch through git f

Re: [Spice-devel] spice-server, logging and style

2015-11-20 Thread Christophe Fergeau
On Tue, Nov 03, 2015 at 08:15:14AM -0500, Frediano Ziglio wrote: > Problems: > - the Spice_style.odt is outdated; > - spice_assert recall the standard assert but instead it mainly > call spice_error which like GLib is fatal and should call exit/abort. > It is not affected by NDEBUG or other def

Re: [Spice-devel] spice-server, logging and style

2015-11-20 Thread Christophe Fergeau
Hello, On Wed, Nov 11, 2015 at 08:35:01PM +0200, Uri Lublin wrote: > On 11/03/2015 05:11 PM, Christophe Fergeau wrote: > I think we should distinguish between internal-errors (spice-server > and maybe also qemu-kvm) and external-errors (spice-client and guest). > > For internal-errors, an unexpec

Re: [Spice-devel] spice-server, logging and style

2015-11-16 Thread Uri Lublin
On 11/16/2015 01:20 PM, Frediano Ziglio wrote: On 11/03/2015 05:11 PM, Christophe Fergeau wrote: Hey, On Tue, Nov 03, 2015 at 08:15:14AM -0500, Frediano Ziglio wrote: Style: Personal considerations: - it seems some changes in patchset change "if (cond) return" code with spice_return_if_f

Re: [Spice-devel] spice-server, logging and style

2015-11-16 Thread Frediano Ziglio
> > On 11/03/2015 05:11 PM, Christophe Fergeau wrote: > > Hey, > > > > On Tue, Nov 03, 2015 at 08:15:14AM -0500, Frediano Ziglio wrote: > >> Style: > >> > >> Personal considerations: > >> - it seems some changes in patchset change "if (cond) return" code with > >>spice_return_if_fail(cond). As

Re: [Spice-devel] spice-server, logging and style

2015-11-11 Thread Uri Lublin
On 11/03/2015 05:11 PM, Christophe Fergeau wrote: Hey, On Tue, Nov 03, 2015 at 08:15:14AM -0500, Frediano Ziglio wrote: Style: Personal considerations: - it seems some changes in patchset change "if (cond) return" code with spice_return_if_fail(cond). As stated before the macro are very mis

Re: [Spice-devel] spice-server, logging and style

2015-11-04 Thread Christophe Fergeau
On Tue, Nov 03, 2015 at 08:15:14AM -0500, Frediano Ziglio wrote: > Personal considerations: > - although is sometimes useful to have errors reported to detect problems > we should consider we should consider that too logging can cause DoS > due to disk consumption, slow down (there are some che

Re: [Spice-devel] spice-server, logging and style

2015-11-03 Thread Christophe Fergeau
Hey, On Tue, Nov 03, 2015 at 08:15:14AM -0500, Frediano Ziglio wrote: > Style: > - why use spice_printerr if all errors basically go to standard error? > - from a first time readers spice_return_if_fail and spice_return_val_if_fail > do not suggest function is doing some logging. > Also they

Re: [Spice-devel] spice-server, logging and style

2015-11-03 Thread Marc-André Lureau
Hi - Original Message - > On Tue, Nov 03, 2015 at 09:17:29AM -0500, Marc-André Lureau wrote: > > > - from a first time readers spice_return_if_fail and > > > spice_return_val_if_fail > > > do not suggest function is doing some logging. Also they use critical > > > level which by defaul

Re: [Spice-devel] spice-server, logging and style

2015-11-03 Thread Marc-André Lureau
- Original Message - > Hi > > - Original Message - > > On Tue, Nov 03, 2015 at 09:17:29AM -0500, Marc-André Lureau wrote: > > > > - from a first time readers spice_return_if_fail and > > > > spice_return_val_if_fail > > > > do not suggest function is doing some logging. Also th

Re: [Spice-devel] spice-server, logging and style

2015-11-03 Thread Christophe Fergeau
On Tue, Nov 03, 2015 at 09:17:29AM -0500, Marc-André Lureau wrote: > > - from a first time readers spice_return_if_fail and > > spice_return_val_if_fail > > do not suggest function is doing some logging. Also they use critical > > level which by default cause program abortion. > > they follow

Re: [Spice-devel] spice-server, logging and style

2015-11-03 Thread Victor Toso
Hi, On Tue, Nov 03, 2015 at 08:15:14AM -0500, Frediano Ziglio wrote: > Hi, > looking at refactory branch and spice-server code looks like logging > facilities are used all around the code for different purposes however > don't looks like there are some specific style or direction to handle > the

Re: [Spice-devel] spice-server, logging and style

2015-11-03 Thread Marc-André Lureau
Hi - Original Message - > Hi, > looking at refactory branch and spice-server code looks like logging > facilities are used all around the code for different purposes however > don't looks like there are some specific style or direction to handle > these stuff. > At http://cgit.freedeskto

[Spice-devel] spice-server, logging and style

2015-11-03 Thread Frediano Ziglio
Hi, looking at refactory branch and spice-server code looks like logging facilities are used all around the code for different purposes however don't looks like there are some specific style or direction to handle these stuff. At http://cgit.freedesktop.org/spice/spice/tree/docs there is a Spice_