logging output format is less awesome that it used to be

Dimiter Naydenov dimiter.naydenov at canonical.com
Tue Mar 19 07:57:18 UTC 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 19.03.2013 08:10, Tim Penhey wrote:
> On 19/03/13 19:32, Ian Booth wrote:
>>
>>
>> On 19/03/13 14:11, David Cheney wrote:
>>> Just to kick over a recently settled hornets nest, the logging
output is less
>>> awesome than it used to be
>>>
>>
>> Was it ever really awesome? I don't think it could be called awesome :-)
>>
>>> ^ why is the date string in the middle of the line? why does every
line start
>>> JUJU rather than INFO/WARN/ERROR/etc ?
>>>
>>
>> The previous logging incarnation did not prepend all lines with
INFO/WARNING etc
>> either - it was done adhoc and most times not at all. Also, lines
were output
>> like so:
>>
>> Target.Output(2, "JUJU "+fmt.Sprintf(format, v...))
>>
>> hence they all started with JUJU just like the current version. So
there's no
>> real difference there AFAICT.
>>
>> The Go log Prefix attribute has been set to "JUJU:<cmd name>", where
<cmd name>
>> evaluates to "<super command>:<sub command>" eg "juju:bootstrap"
>>
>> The Go logger puts the log prefix as the first thing on the line,
before the
>> formatted header containing the datetime. Go's logger appears very
primitive and
>> it's not possible AFAIK to log using a format template where such
things can be
>> controlled properly :-(
>>
>> The current logging offers a consistently formatted message:
>>
>> JUJU:<cmd name>:<datetime> <severity> <message>
>>
>>> Is this going to be fixed by a followup branch ?
>>>
>>> Should I log a bug about this ?
>>>
>>
>> It would have been nice to done more with this but time moves on and
my main
>> focus was to ensure consistent output containing the key pieces of
information
>> to help facilitate supportability. I guess it depends what fixed
means. We are
>> limited by what Go std lib offers here, unless we want to do a bit of
bespoke
>> work, in which case we'd have our own logger implementation. Maybe if
we want to
>> identify what key issue(s) in particular are irksome, they can be
quickly fixed.
>
>
> If we are going to change it, I'd suggest something like
>
> <datetime> <severity> <cmd name> <message>
>
> Tim
>
>
definitely +1 on this!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJRSBpdAAoJENzxV2TbLzHwOeYIAMmTNEoSGYnb3Zpxb7SEZPq4
UzmYlZxMExm+n+oRJ4qSHkiH33iaNKT4nNAK3pNBY3TwSztEgPJWcEj1+wnEpRcL
mopX3sKheZ8QcTLdUswRYYbxxLK93w2URXq1sCyTrIMH7YWSwXgehYXMubM5MVOc
8aSsGBWEBpIRGqdpAVxwNHktCBPZ6EC9P25Er339+um+6sFJFfw7mwxacjcA9mxa
0TeetOZSzBqs03oH1OmuPG83zlLKwcFJOaE3dX+RWwkP0JKOn7UT0cqp30n48u4s
92e6BtIhtwFYfQjjsI+6PU2GkbOxn/ske5BrMt2bByj82Grzr1fobkgHA3OMSVA=
=hqqk
-----END PGP SIGNATURE-----




More information about the Juju-dev mailing list