[Pkg-javascript-commits] [node-ain2] 81/102: Imported Upstream version 1.1.1

Jonas Smedegaard js at moszumanska.debian.org
Tue Apr 29 11:59:51 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 978cae9b01cd199e1426dc336594ebf8303a17ce
Author: Jonas Smedegaard <dr at jones.dk>
Date:   Wed Nov 28 23:56:32 2012 +0100

    Imported Upstream version 1.1.1
---
 CHANGELOG.md |  9 +++++++
 index.js     | 16 +++++++-----
 package.json | 84 +++++++++++++++++++++++++++++++++---------------------------
 3 files changed, 65 insertions(+), 44 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 31d4c16..cbcf040 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,14 @@
 # CHANGELOG
 
+## v1.1.1
+
+Bugfix release
+
+* The logging to file function crashed on unsupported systems due to
+  immediate execution
+
+
+
 ## v1.1.0
 
 * Custom message composer
diff --git a/index.js b/index.js
index 04ce270..f28bf2f 100644
--- a/index.js
+++ b/index.js
@@ -29,19 +29,23 @@ var Transport = {
 
         switch(require('os').type()) {
             case 'Darwin': 
+            case 'FreeBSD':
                 logTarget = '/var/run/syslog' ;
                 break ;
 
             case 'Linux':
                 logTarget = '/dev/log' ;
                 break ;
-
             default:
-                throw new Error('Unknown OS Type: ' + require('os').type()) ;
-
+                logTarget = false ;
+                break ;
         }
 
         return function(message, severity) {
+            if (false === logTarget) {
+                throw new Error('Unknown OS Type: ' + require('os').type()) ;
+            }
+
             var client = dgram.createSocket('unix_dgram') ;
             var syslogMessage = this.composerFunction(message, severity);
             client.send(syslogMessage,
@@ -179,7 +183,7 @@ SysLogger.prototype.set = function(config) {
     } else {
         this.setTransport(config.transport) ;
     }
-    
+
     return this;
 };
 
@@ -197,7 +201,7 @@ SysLogger.prototype.setTag = function(tag) {
 };
 SysLogger.prototype.setFacility = function(facility) {
     this.facility = facility || Facility.user;
-    if (typeof this.facility == 'string'){ 
+    if (typeof this.facility == 'string'){
         this.facility = Facility[this.facility];
     }
     return this;
@@ -281,7 +285,7 @@ SysLogger.prototype.debug = function() {
  */
 SysLogger.prototype.composeSyslogMessage = function(message, severity) {
     return new Buffer('<' + (this.facility * 8 + severity) + '>' +
-            this.getDate() + ' ' + this.hostname + ' ' + 
+            this.getDate() + ' ' + this.hostname + ' ' +
             this.tag + '[' + process.pid + ']:' + message);
 }
 
diff --git a/package.json b/package.json
index 518f80c..43a3ec2 100644
--- a/package.json
+++ b/package.json
@@ -1,38 +1,46 @@
-{
-    "name" : "ain2",
-    "description" : "Syslog logging for node.js. Continuation of ain",
-    "version" : "1.1.0",
-    "main" : "./index",
-    "author" : "Alexander Dorofeev <aka.spin at gmail.com>",
-    "contributors" : [
-        {
-            "name" : "Alexander Dorofeev",
-            "email" : "aka.spin at gmail.com"
-        },
-        {
-            "name" : "Patrick Huesler",
-            "email" : "patrick.huesler at googlemail.com"
-        },
-        {
-            "name" : "Mark Wubben",
-            "email" : "mark at novemberborn.net"
-        },
-        {
-            "name" : "Parham Michael Ossareh",
-            "email" : "ossareh at gmail.com"
-        }
-    ],
-    "repository" : {
-        "type" : "git",
-        "url" : "http://github.com/phuesler/ain.git"
-    },
-    "bugs" : {
-        "url" : "http://github.com/phuesler/ain/issues"
-    },
-    "licenses" : [
-        {
-            "type": "MIT",
-            "url": "http://github.com/phuesler/ain/master/LICENSE"
-        }
-    ]
-}
+{
+    "name" : "ain2",
+    "description" : "Syslog logging for node.js. Continuation of ain",
+    "version" : "1.1.1",
+    "main" : "./index",
+    "author" : "Alexander Dorofeev <aka.spin at gmail.com>",
+    "contributors" : [
+        {
+            "name" : "Alexander Dorofeev",
+            "email" : "aka.spin at gmail.com"
+        },
+        {
+            "name" : "Patrick Huesler",
+            "email" : "patrick.huesler at googlemail.com"
+        },
+        {
+            "name" : "Mark Wubben",
+            "email" : "mark at novemberborn.net"
+        },
+        {
+            "name" : "Parham Michael Ossareh",
+            "email" : "ossareh at gmail.com"
+        },
+        {
+            "name" : "Carlos Lage",
+            "email" : "carlos.lage at livestream.com"
+        },
+        {
+            "name" : "J. Maurice",
+            "email" : "j at wiz.biz"
+        }
+    ],
+    "repository" : {
+        "type" : "git",
+        "url" : "http://github.com/phuesler/ain.git"
+    },
+    "bugs" : {
+        "url" : "http://github.com/phuesler/ain/issues"
+    },
+    "licenses" : [
+        {
+            "type": "MIT",
+            "url": "http://github.com/phuesler/ain/master/LICENSE"
+        }
+    ]
+}

-- 
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