[Pkg-javascript-commits] [node-ain2] 53/102: Allow more than one instance of ain
Jonas Smedegaard
js at moszumanska.debian.org
Tue Apr 29 11:59:49 UTC 2014
This is an automated email from the git hooks/post-receive script.
js pushed a commit to branch master
in repository node-ain2.
commit e62f5398bcb868bf4230cdb4fba510cc86c76d1a
Author: Patrick Huesler <patrick.huesler at gmail.com>
Date: Mon Jan 2 16:48:52 2012 +0100
Allow more than one instance of ain
You want to have serveral loggers with differerent configurations
---
index.js | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/index.js b/index.js
index 122e36b..fb57088 100644
--- a/index.js
+++ b/index.js
@@ -167,13 +167,15 @@ function format(f) {
* @constructor
* @returns {SysLogger}
*/
-function SysLogger() {
+function SysLogger(config) {
this._times = {};
this._logError = function(err, other) {
if(err){
nodeConsole.error('Cannot log message via %s:%d', this.hostname, this.port);
}
}.bind(this);
+ this.set(config);
+ return this;
}
/**
@@ -330,6 +332,4 @@ SysLogger.prototype.assert = function(expression) {
}
};
-var logger = new SysLogger();
-logger.set();
-module.exports = logger;
+module.exports = SysLogger;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-ain2.git
More information about the Pkg-javascript-commits
mailing list