[webgen-devel] [TL] Better patch

Thomas Leitner t_leitner at gmx.at
Thu Sep 20 04:26:15 EDT 2007


From: Thomas Leitner <t_leitner at gmx.at>
Date: 28. August 2007 10:06:46 GMT+02:00
To: Andrea Ferro
Subject: Re: Better patch


On 27.08.2007, at 12:23, Andrea Ferro wrote:

>
> Of course there were many glitches in the patch I sent you yesterday.
>
> This one replaces it (it is against the current rubyforge  
> repository) and is more complete.
>
> The new logging should work as expected for non-plugin and non node  
> objects. Also configurations for it can be specified (with minor  
> limitations).
>
> The new startup sequence solves the problems we found (including  
> those with autoload plugins) and is much more flexible/customizable  
> for those who may want to use webgen as a library (and create  
> WebSite, PluginManager etc. programmatically from within their  
> application).
>
> I think cli.rb, website.rb and maybe some other sources should be  
> very close to final.
>
> I'm now in a little of documentation effort. See the most important  
> concepts already correctly documented in website.rb (and less  
> correctly in logaid.rb).

Thanks for the patch! I have looked over it and the new logging  
facility seems really cool. Some comments:

* If I set Core/WebSite:tracingLevel to 0 in the configuration file  
and don't use the loggingLevel switch from the CLI program, I get no  
trace statements - should this be so? I think the problem stems from  
the GlobalLogger.logger since its logging level is set to ERROR and  
therefore no statements are printed. I don't know if this should be  
so by design, however, if I set the tracingLevel explicitly in the  
configuration file I do want the output, independent from the global  
logging level.

* The use of the autoload plugin feature isn't exactly what I made it  
for. It should 'autoload' the plugins, no manual intervention  
necessary. The PluginManager is able to do this independently from an  
explicit call to #autoload_plugins since it just needs to check after  
the availability of all dependencies after a plugin bundle has been  
loaded. I have updated the respective code parts and attached a patch  
against your latest 070827-12-andrea.patch. Since an explicit call to  
WebSite#reset is now needed and everything has to be setup before  
this call, all configurations et al should be in place when  
@plugin_manager.load_all_plugin_bundles is called; therefore all  
autoload plugins should get the correct informations/parameter values.

* Have a look at lib/webgen/plugin.rb:43 (the  
Webgen::Plugin::ClassMethods#log method), there you can see how the  
calling method is extracted from the call stack. Could be used in lib/ 
webgen/logaid.rb in LogAid#log and LogAid#trace to automatically  
extract the progname part instead of requiring of every caller to set  
it manually.

* Webgen::WebSite.new( 'dir' ).reset returns the website object. I  
know it is more concise to only need a single line but does one  
really expect to get the website object back from the reset method?

Will look deeper into this this evening or tomorrow morning!

-- Thomas



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/webgen-devel/attachments/20070920/78600541/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 070828-autoload.patch
Type: application/octet-stream
Size: 3302 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/webgen-devel/attachments/20070920/78600541/attachment.obj 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/webgen-devel/attachments/20070920/78600541/attachment-0001.html 


More information about the webgen-devel mailing list