Skip to content

Commit 7273275

Browse files
committed
fix: logging for task parameters
Depth was preventing to log the correct values fixes #25
1 parent b01f770 commit 7273275

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

index.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -112,22 +112,22 @@ Gulp.prototype.tree = function (stack, options) {
112112
if (options.simple) { return tasks; }
113113
}
114114

115-
var tree = {label: options.label || '', nodes: []};
116-
var depth = options.depth === void 0 || options.depth;
117-
if (depth && typeof depth !== 'number') { depth = 1; }
115+
var tree = {
116+
label: options.label || '',
117+
nodes: []
118+
};
118119

119120
tasks.forEach(function (task) {
120121
if (!task || !task.fn) { return; }
121122
var node;
122123

123124
if (Array.isArray(task.fn.stack)) {
124125
node = self.tree(task.fn.stack, {
125-
host: task,
126-
depth: depth && (depth + 1) || false
126+
host: task
127127
});
128128
} else {
129129
node = {
130-
label: depth == 1 && (task.match || task.name) || task.name
130+
label: task.match || task.name
131131
};
132132
}
133133

@@ -188,12 +188,11 @@ Gulp.prototype.onHandleStart = function (task, stack) {
188188
if (!stack.time) {
189189
stack.time = process.hrtime();
190190
stack.label = this.tree(stack).label;
191+
}
191192

192-
if (Array.isArray(task.fn && task.fn.stack) && task.fn.stack.props) {
193-
stack.match = task.match || task.name || task.displayName;
194-
stack.siteProps = task.fn.stack.props;
195-
}
196-
193+
if (Array.isArray(task.fn && task.fn.stack) && task.fn.stack.props) {
194+
stack.match = task.match || task.name || task.displayName;
195+
stack.siteProps = task.fn.stack.props;
197196
util.log('Start', util.format.task(stack));
198197
}
199198

0 commit comments

Comments
 (0)