[Masterview-users] Logging from within a directive

Deb Lewis
Fri, 09 Jun 2006 19:20:14 -0000

Ed Howland wrote:

>> I assume that the default logging level is Logger::DEBUG ... [based on]
masterview plugin''s init.rb

The next release of MasterView will include a rework of the mechanisms for
customizing the MasterView configuration.  The new approach will be similar
to the style used for rails app configuration, where you customize the
settings for your app by providing initialization specs in your config
directory, setting values in the configuration and allowing for
environment-dependent settings which override/augment the general config for
your app.

There''ll be documentation on all the supported configuration options
and
description of how to use them, along with some sort of example/prototype
config file so it''s easy to drop in and get going if you want something
different than the standard defaults,.

I''ll make sure there are options supported to allow configuring the
logging
facilities.  (that area isn''t quite sorted out, working on that right
now)

[p.s. introducing myself: I''m currently working with Jeff on some
enhancements to MasterView, having recently picked it up to use in a rails
development project I''m doing and deciding there were some things I
wanted
added or done differently.  kudos to Jeff, he''s done a really nice job
creating MasterView]

~ Deb

  _____

From: masterview-users-bounces at rubyforge.org
[mailto:masterview-users-bounces at rubyforge.org] On Behalf Of Jeff Barczewski
Sent: Thursday, June 08, 2006 1:29 PM
To: masterview-users at rubyforge.org
Subject: Re: [Masterview-users] Logging from within a directive


The Logger is set on the MasterView module so you would probably need to
refer to it like

MasterView::Log.debug "foo"

or even better use

MasterView::Log.debug { "foo" }

The second form is better since it is a block and the block won''t get
executed if the output level is above debug which saves cpu if you were
doing any string building concatenating, etc.
-------------- next part --------------
An HTML attachment was scrubbed...