Trace/Logger design for Hobo::Dryml
------------------------------------
DRYML tracing will be implemented as a plugin
On load, the following DRYML classes are opened

Hobo::Dryml
- Template
- TemplateEnvironment
- TemplateHandler
- Taglib
- DRYMLBuilder

from template_environment.rb
- ActionController::Base
- ActionView::Template
- ActionView::Pathset

All these will have the TraceCalls module included

TraceCalls hooks into the hooks "included" and "method_added", that in
turn redefines (decorates) each method added and injects 'before' and
'after' aspects in the form of log statements:

The traced method takes the form
 log "[modules::class_name.method_name] : BEGIN"
 log "[parameters]"
 method call
 log "[modules::class_name.method_name] : END"
 log "[return data]"

Note, that you can specify filter lists to indicate exactly which
methods to include/exclude for tracing.
The filter lists even support regular expression matching, so you
might fx say /polymorphic/ to include methods with the word
"polymorphic" in them! Another reason to uphold a good naming
convention for methods ;)

each 'log' method call will carry the following arguments:
- module, class, method where log method was called
- path of current template being processed

The log statement will then always be sent to a "chain of
responsibility", consisting of a set of pluggable filters.
The result of each filter will have the option to send the log
statement to one or more log "appenders" (log4j style)

Fx, if class where log statement orinates matches "classes to
include", the log statement could be sent to a special logfile for
that class. All log statements send to a "main dryml logfile" and if
within a template of a specific type, send to special logfile for that
template...

Methods in each of the DRYML classes will be organized into one or
more tiers (levels),
so that you will have a list of "core" methods (at the top lv) and
methods at lower levels.
This way you can specify that you want only an "overview" logging (top
level), or more detailed DRYML logging (lower levels)

---
What do you think about this design? Any comments, ideas, suggestions
are welcome!

Kristian
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to