Skip to content

Commit 314d1f5

Browse files
committed
(bluefox) add silly debug level
1 parent 6d45a9c commit 314d1f5

File tree

13 files changed

+61
-12
lines changed

13 files changed

+61
-12
lines changed

lib/adapter.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ function Adapter(options) {
9191

9292
var logger = require(__dirname + '/logger.js')(config.log);
9393

94+
// compatibility
95+
if (!logger.silly) {
96+
logger.silly = logger.debug;
97+
}
98+
9499
// enable "var adapter = require(__dirname + '/../../lib/adapter.js')('adapterName');" call
95100
if (typeof options === 'string') options = {name: options};
96101

@@ -4486,14 +4491,18 @@ function Adapter(options) {
44864491
var Log = function () {};
44874492

44884493
if (config.consoleOutput) {
4489-
Log.prototype.info = function (msg) {
4494+
Log.prototype.silly = function (msg) {
44904495
console.log(msg);
4491-
logger.info(that.namespace + ' ' + msg);
4496+
logger.silly(that.namespace + ' ' + msg);
44924497
};
44934498
Log.prototype.debug = function (msg) {
44944499
console.log(msg);
44954500
logger.debug(that.namespace + ' ' + msg);
44964501
};
4502+
Log.prototype.info = function (msg) {
4503+
console.log(msg);
4504+
logger.info(that.namespace + ' ' + msg);
4505+
};
44974506
Log.prototype.error = function (msg) {
44984507
console.error(msg);
44994508
logger.error(that.namespace + ' ' + msg);
@@ -4503,12 +4512,15 @@ function Adapter(options) {
45034512
logger.warn(that.namespace + ' ' + msg);
45044513
};
45054514
} else {
4506-
Log.prototype.info = function (msg) {
4507-
logger.info(that.namespace + ' ' + msg);
4515+
Log.prototype.silly = function (msg) {
4516+
logger.silly(that.namespace + ' ' + msg);
45084517
};
45094518
Log.prototype.debug = function (msg) {
45104519
logger.debug(that.namespace + ' ' + msg);
45114520
};
4521+
Log.prototype.info = function (msg) {
4522+
logger.info(that.namespace + ' ' + msg);
4523+
};
45124524
Log.prototype.error = function (msg) {
45134525
logger.error(that.namespace + ' ' + msg);
45144526
};

lib/dbdump.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ var Objects = require(__dirname + '/objects.js');
3131

3232
var db = new Objects({
3333
logger: {
34+
silly: function (msg) { },
3435
debug: function (msg) { },
3536
info: function (msg) { },
3637
warn: function (msg) {

lib/logger.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ var logger = function (level, files, noStdout, prefix) {
2222
var options = {
2323
transports: []
2424
};
25+
2526
//var defaultMaxSize;// = 10 * 1024 * 1024;
2627

2728
if (typeof files === 'string') {

lib/objects/objectsInCouch.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ function ObjectsCouch(settings) {
2222
var couch;
2323
var change;
2424

25+
if (!log.silly) {
26+
log.silly = log.debug;
27+
}
28+
2529
var __construct = (function () {
2630

2731
host = settings.connection.host || 'localhost';

lib/objects/objectsInMemClient.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,18 @@ function ObjectsInMemClient(settings) {
4949
var log = settings.logger;
5050
if (!log) {
5151
log = {
52-
info: function (msg) {/*console.log(msg);*/},
52+
silly: function (msg) {/*console.log(msg);*/},
5353
debug: function (msg) {/*console.log(msg);*/},
54+
info: function (msg) {/*console.log(msg);*/},
5455
warn: function (msg) {
5556
console.log(msg);
5657
},
5758
error: function (msg) {
5859
console.log(msg);
5960
}
6061
};
62+
} else if (!log.silly) {
63+
log.silly = log.debug;
6164
}
6265

6366
var __construct = (function () {

lib/objects/objectsInMemServer.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,18 @@ function ObjectsInMemServer(settings) {
106106
var log = settings.logger;
107107
if (!log) {
108108
log = {
109-
info: function (msg) {/*console.log(msg);*/},
109+
silly: function (msg) {/*console.log(msg);*/},
110110
debug: function (msg) {/*console.log(msg);*/},
111+
info: function (msg) {/*console.log(msg);*/},
111112
warn: function (msg) {
112113
console.log(msg);
113114
},
114115
error: function (msg) {
115116
console.log(msg);
116117
}
117118
};
119+
} else if (!log.silly) {
120+
log.silly = log.debug;
118121
}
119122

120123
var server = {

lib/objects/objectsInRedis.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,18 @@ function ObjectsInMem(settings) {
7575
var log = settings.logger;
7676
if (!log) {
7777
log = {
78-
info: function (msg) {/*console.log(msg);*/},
78+
silly: function (msg) {/*console.log(msg);*/},
7979
debug: function (msg) {/*console.log(msg);*/},
80+
info: function (msg) {/*console.log(msg);*/},
8081
warn: function (msg) {
8182
console.log(msg);
8283
},
8384
error: function (msg) {
8485
console.log(msg);
8586
}
8687
};
88+
} else if (!log.silly) {
89+
log.silly = log.debug;
8790
}
8891

8992
// -------------- FILE FUNCTIONS -------------------------------------------

lib/setup.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2905,6 +2905,8 @@ function dbConnect(onlyCheck, params, callback) {
29052905
objects = new Objects({
29062906
connection: config.objects,
29072907
logger: {
2908+
silly: function (msg) {
2909+
},
29082910
debug: function (msg) {
29092911
},
29102912
info: function (msg) {
@@ -2934,6 +2936,8 @@ function dbConnect(onlyCheck, params, callback) {
29342936
states = new States({
29352937
connection: config.states,
29362938
logger: {
2939+
silly: function (msg) {
2940+
},
29372941
debug: function (msg) {
29382942
},
29392943
info: function (msg) {
@@ -2961,6 +2965,7 @@ function dbConnect(onlyCheck, params, callback) {
29612965
objects = new Objects({
29622966
connection: config.objects,
29632967
logger: {
2968+
silly: function (msg) { },
29642969
debug: function (msg) { },
29652970
info: function (msg) { },
29662971
warn: function (msg) {
@@ -2981,6 +2986,7 @@ function dbConnect(onlyCheck, params, callback) {
29812986
states = new States({
29822987
connection: config.states,
29832988
logger: {
2989+
silly: function (msg) { },
29842990
debug: function (msg) { },
29852991
info: function (msg) { },
29862992
warn: function (msg) {

lib/states/statesInMemClient.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,18 @@ function StatesInMemClient(settings) {
2020
var log = settings.logger;
2121
if (!log) {
2222
log = {
23-
info: function (msg) {/*console.log(msg);*/},
23+
silly: function (msg) {/*console.log(msg);*/},
2424
debug: function (msg) {/*console.log(msg);*/},
25+
info: function (msg) {/*console.log(msg);*/},
2526
warn: function (msg) {
2627
console.log(msg);
2728
},
2829
error: function (msg) {
2930
console.log(msg);
3031
}
3132
};
33+
} else if (!log.silly) {
34+
log.silly = log.debug;
3235
}
3336

3437
var __construct = (function () {

lib/states/statesInMemServer.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ var getDefaultDataDir = require(__dirname + '/../tools').getDefaultDataDir;
1919
// change: function (id, state) {},
2020
// connected: function (nameOfServer) {},
2121
// logger: {
22-
// info: function (msg) {},
22+
// silly: function (msg) {},
2323
// debug: function (msg) {},
24+
// info: function (msg) {},
2425
// warn: function (msg) {},
2526
// error: function (msg) {}
2627
// },
@@ -84,15 +85,18 @@ function StatesInMemory(settings) {
8485
var log = settings.logger;
8586
if (!log) {
8687
log = {
87-
info: function (msg) {/*console.log(msg);*/},
88+
silly: function (msg) {/*console.log(msg);*/},
8889
debug: function (msg) {/*console.log(msg);*/},
90+
info: function (msg) {/*console.log(msg);*/},
8991
warn: function (msg) {
9092
console.log(msg);
9193
},
9294
error: function (msg) {
9395
console.log(msg);
9496
}
9597
};
98+
} else if (!log.silly) {
99+
log.silly = log.debug;
96100
}
97101

98102
var server = {

0 commit comments

Comments
 (0)