Lager question...

Bryan Hughes bryan at wobblesoft.com
Sun Aug 28 13:56:58 EDT 2011


Hi Everyone,

Wasnt sure where to post this question, so sorry if this is the wrong place.

We have Riak as our persistence and have decided to switch to Lager as 
our logging framework for the entire system - good  stuff!!! So far 
things have been going well.  Unfortunately I am encountering unexpected 
results from the same code running on Erlang R14B02 (erts-5.8.3) on a 
MacBook Pro and a 32bit Ubuntu 11 instance.  Both Erlangs were 
downloaded from source and compiled with the same flags.

The issue is with the formatted results of a float using ~w.

On the Linux instance:

(herd at 127.0.0.1)4> lager:log(info, self(), "~w", [1.0]).
22:33:32.329 [info] 1.00000000000000000000e+00
ok

On the Mac:

(herd at 127.0.0.1)2> lager:log(info, self(), "~w", [1.0]).
22:43:22.208 [info] 1.0
ok

~p formats correctly, but it also prettifies the output which is not 
desirable for logs that may be parsed later.

Cheers,
Bryan




More information about the riak-users mailing list