[zeromq-dev] [PATCH] Improved response to socket violations
Martin Lucina
mato at kotelna.sk
Mon May 23 16:22:55 CEST 2011
sustrik at 250bpm.com said:
> On 05/23/2011 03:22 AM, Ian Barber wrote:
> >
> >
> > On Fri, May 20, 2011 at 4:50 PM, Martin Lucina <mato at kotelna.sk
> > <mailto:mato at kotelna.sk>> wrote:
> >
> > 3) Last but not least, IMHO libraries should *not* print "helpful"
> > messages. This leads to horrible practices, for example start a
> > random Gtk
> > application; you will more often than not see all sorts of assertion
> > failures and other crap printed and it's obvious that no one cares, much
> > less does anything about it.
> >
> >
> > I have to say I am a big +1 on not ever printing from libzmq - to be
> > honest even in cases where it completely blows up, I've worked with
> > bindings for a library that does that and it's can make it very hard to
> > have consistent responses to failures when sometimes extra output starts
> > occurring.
>
> Are you guys saying you want silent failures, ie. application asserts
> without even printing out the error? If so, I guess it can be done as a
> compile time option.
I'm saying keep the library as silent as possible. Fatal assertions are
obviously fine and should be printed, but as I wrote in another thread we
should work towards making libzmq as robust as possible; i.e. in an ideal
future version you'd only get a fatal assertion if you hit an actual
internal bug. Everything else would be reported back to the application
somehow (either API calls or sys://log or a similar tool for asynchronous
events).
Just my 2c.
-mato
More information about the zeromq-dev
mailing list