[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v3 5/8] golang/xenlight: Default loglevel to DEBUG until we get everything working


  • To: Nick Rosbrook <rosbrookn@xxxxxxxxx>
  • From: George Dunlap <George.Dunlap@xxxxxxxxxx>
  • Date: Tue, 21 Jan 2020 09:55:54 +0000
  • Accept-language: en-GB, en-US
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=George.Dunlap@xxxxxxxxxx; spf=Pass smtp.mailfrom=George.Dunlap@xxxxxxxxxx; spf=None smtp.helo=postmaster@xxxxxxxxxxxxxxx
  • Cc: Nick Rosbrook <rosbrookn@xxxxxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 21 Jan 2020 09:56:13 +0000
  • Ironport-sdr: F/YJ82/IRNbqLkwri8H5DaS2a4n8KVAThJbUhtOJY2kwCg4BiUnxveke1B8+gdD5qHmqVPgOgj zlQK6ht2iiqbJyFPrQrGOGdqga1ntiHLO/kSDAx9c4we+SCJahqw64E3+1nxBDbC2PQnZyTDGE mtumIcYn357ZCfegb5CDjYeuwBs9yPH/LLuPy5KsSw68AooOVB8IoAMsuhkV7B2jVnd/xyd79X QlkOat52a2TrZofENcYre+eOZNL3FXsuMVpR0PuisKePlh7nqUY+cZ3YIvXs9lmOz/s21KX1FJ J5A=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVzU7ZRIoOloQjE0axTALd7TBR5qf0KuYAgACrqQA=
  • Thread-topic: [Xen-devel] [PATCH v3 5/8] golang/xenlight: Default loglevel to DEBUG until we get everything working


> On Jan 20, 2020, at 11:41 PM, Nick Rosbrook <rosbrookn@xxxxxxxxx> wrote:
> 
>> The other option would be to expose the XTL logging levels and let the
>> caller set them somehow.
> I think this is fine for now.
> 
> For the future, I like using the "functional option" pattern for this
> sort of thing. That way, if a user wanted to set a non-default log
> level, they could do:
> 
> ctx, err := xenlight.NewContext(xenlight.WithLogLevel(lvl))
> 
> but if they do not need to specify any options, it's still just:
> 
> ctx, err := xenlight.NewContext()

You know, I somehow remembered the “use a function to set options” pattern (and 
have a  mock-up for that in the “NewType()” patch later), but didn’t notice 
that such function were variadic.  That’s a lot nicer.

But really, we need a way to actually create a logger properly.  Apparently one 
thing libvirt does is to create a logger to a file for each guest.  That’s 
something our package users  might want to do at some point.

 -George
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.