Skip to content

Commit

Permalink
Make tracing use the general debug filter if a trace filter is not sp…
Browse files Browse the repository at this point in the history
…ecified. Update debug doc comments
  • Loading branch information
briancavalier committed Dec 14, 2011
1 parent ef1d113 commit 6094f54
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions wire/debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
* trace: {
* // filter (Optional)
* // Similar to above, can be string pattern or RegExp
* // Default ".*"
* // If not specified, the general debug filter is used (see above)
* filter: ".*View",
*
* // pointcut (Optional)
Expand All @@ -65,8 +65,11 @@
* // At what step in the wiring process should tracing start. This can be helpful
* // if you need to trace a component during wiring.
* // Values: 'create', 'configure', 'initialize', 'ready', 'destroy'
* // Default: 'initialize'
* step: 'initialize'
* // NOTE: This defines when tracing *begins*. For example, if this is set to
* // 'configure' (the default), anything that happens to components during and
* // after the configure step, until that component is destroyed, will be traced.
* // Default: 'configure'
* step: 'configure'
* }
* }
*/
Expand Down Expand Up @@ -185,7 +188,7 @@ define(['aop'], function(aop) {
}

/** Default lifecycle step at which to begin tracing */
defaultStep = 'initialize';
defaultStep = 'configure';

/** Default pointcut query to match methods that will be traced */
defaultPointcut = /^[^_]/;
Expand Down Expand Up @@ -238,10 +241,10 @@ define(['aop'], function(aop) {
/**
* Implementation of createTracer
*/
return function(options, plugin) {
return function(options, plugin, filter) {
var trace, untrace, traceStep, traceFilter, tracePointcut, traceAspects;

traceFilter = createPathFilter(options.trace.filter);
traceFilter = options.trace.filter ? createPathFilter(options.trace.filter) : filter;
tracePointcut = options.trace.pointcut || defaultPointcut;
traceStep = options.trace.step || defaultStep;

Expand Down Expand Up @@ -405,7 +408,7 @@ define(['aop'], function(aop) {
};

if (options.trace) {
tracer = createTracer(options, plugin);
tracer = createTracer(options, plugin, filter);
}

return plugin;
Expand Down

0 comments on commit 6094f54

Please sign in to comment.