On 10 Apr 2013, at 08:16, S Krish <krishnamachari.sudhakar@gmail.com> wrote:
Can you elaborate the use case / details on the block argument..?
self logger debug: [ 'Now sending {1} to {2}' format: { x printString. y printString } ]. 1. when nobody upstream needs the actual value because debug logging is disabled, you don't pay the price of computing it. 2. I also recently added a handler that catches errors while computing the value, which prevents nasty loops in error handling. Production code should pay as small a price as possible when using logging.
On Wed, Apr 10, 2013 at 11:38 AM, Sven Van Caekenberghe <sven@stfx.eu> wrote:
On 10 Apr 2013, at 07:27, S Krish <krishnamachari.sudhakar@gmail.com> wrote:
convenience messages thereafter also be the same api viz: logger info: 'This info' . logger warn: 'This warning' . logger error: 'this exception' et als..
Agreed, as long as you also accept blocks as argument so that nothing happens when logging is disabled.
Sven
PS: There is a small Zinc-HTTP-Logging framework in the image as well.
-- Sven Van Caekenberghe Proudly supporting Pharo http://pharo.org http://association.pharo.org http://consortium.pharo.org