Skip to content

Commit dc6e8ff

Browse files
committed
removed parentheses around group name
added feature to set groupEnd string updated docs updated version
1 parent b1bc1b5 commit dc6e8ff

6 files changed

Lines changed: 16 additions & 12 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ The all options have defaults.
7777
* `info(...)` - Add/display a info. See <a href="https://developer.mozilla.org/en-US/docs/Web/API/console.info" target="_blank">console.info</a> Options
7878
* `trace(...)` - Add/display a trace. See <a href="https://developer.mozilla.org/en-US/docs/Web/API/console.trace" target="_blank">console.trace</a> Options
7979
* `group([name])` - Add/display a group. Optional `name` (default: `group`).
80-
* `groupEnd()` - Add/display a groupEnd. No parameters.
80+
* `groupEnd([name])` - Add/display a groupEnd. Optional `name` (default: same `name` as group).
8181
* `clearBuffer()` - Clears the in memory buffer.
8282
* `getBuffer()` - Returns an Array of Strings after running each log thought the `buffer.formatFunc`. Warning browser users: `getBuffer()` may not return expected results unless you include the <a href="https://github.com/alexei/sprintf.js">sprintf</a> library.
8383
* `getRawBuffer()` - Returns the raw buffer (Array of Objects) with all the captured data.

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Stumpy",
3-
"version": "0.6.0",
3+
"version": "0.6.1",
44
"main": "lib/stumpy.js",
55
"ignore": [
66
"node_modules",

examples/node/showntell.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ console.group();
2323
console.warn("test group warn", { obj: "Group1" } );
2424
console.error("test group error: %d", 123);
2525

26-
console.group("test group 2");
26+
console.group("start test group 2");
2727
console.log("test", "Group", 2);
28-
console.warn("test", { obj: "Group2" } );
29-
console.groupEnd();
28+
console.warn("test", { obj: "Group2" } );
29+
console.groupEnd("end test group 2");
3030

3131
console.groupEnd();
3232

lib/stumpy-min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/stumpy.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -396,10 +396,14 @@ Stumpy.prototype._addLogType = function(type) {
396396
log.groups = deepCopy(this._groups);
397397

398398
// remove last group
399-
if( type === 'groupEnd') {
399+
if( type === 'groupEnd' ) {
400400
var groupName = this._groups.pop();
401-
// set args to last groupName
402-
log.args = [ groupName ];
401+
402+
// if no arg passed in
403+
if(log.args.length < 1) {
404+
// set args to last groupName
405+
log.args = [ groupName ];
406+
}
403407
}
404408

405409
if(this._options.formatFunc) {
@@ -652,7 +656,7 @@ function serverFormatFunc(log, options){
652656
if(log.groups.length) {
653657
if (log.type === 'group' ||
654658
log.type === 'groupEnd') {
655-
log.args[0] = '('+log.args[0]+')'
659+
log.args[0] = log.args[0];
656660
}
657661

658662
for(var i = 0; i < log.groups.length-1; i++) {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "stumpy",
3-
"version": "0.6.0",
4-
"description": "The Kickass logger",
3+
"version": "0.6.1",
4+
"description": "The Kickass Logger",
55
"keywords": [
66
"node.js",
77
"javascript",

0 commit comments

Comments
 (0)