On 13 Jan 2004, at 09:47, Steven Noels wrote:
On Jan 13, 2004, at 7:56 AM, Sylvain Wallez wrote:
However, do we really need a new sitemap statement? What about a simple log action: <map:act type="log" src="blah blah"/>?
+1
IMHO, I find adding a println() type construct to the sitemap a bit of a hack (but admittedly less work than coming up with a full-blown debugging API + tools - although this approach might be better suited for all the different styles of development possible in Cocoon). I know the Apples concept is essentially doomed, but I saw Marc once hooking the Eclipse debugger into an Apple, and that seriously kicked ass - you don't need println() anymore of you have a full-blown debugger at your service.
Seriously, this time, but I *do* think that if you ever feel the need for a debugger, you have a problem.
The Java Debug Interface is supposed to allow you to "inject" rewritten code into the system. That might work for simple stuff, but I don't buy that it could be able to work on top of, say, three different classloaders (Loader + cocoon block manager + flowscript compiling classloader).
I think that any form of serious logging is kickass as a debugging tool. Debuggers to give you the perception that things can be traced linearely, but this is rarely the case on the server side. Concurrency and debuggers simply don't match.
And if you want to find out why your pipeline isn't called, logging the message is more than enough to find out.
I'm dead serious when I think that debuggers brain-damange their users: debugging a program with a debugger instead of with a ton of println is *much* slower for me. not only because of the many layers of tool that have to run around my program, but also because logging forces you to think about a strategy, think about where the problems could be.. you are *actively* debugging... debuggers turn your thinking into passive mode, you don't have a strategy, you don't think in advance.
Having the ability to log directly from the sitemap is a great idea, just like print() or cocoon.log() in flow is *super useful*
[and I agree with Vadim that <map:log> is much better than an attribute]
As for <map:act type="log">, it would achieve the same effect, yes, but I think this is worth putting in the semantics of the sitemap as to indicate to our users that this is the way we suggest them to look into their sitemaps dynamics... an action might not give the same vision.
-- Stefano.
