[Pkg-javascript-commits] [node-ain2] 24/102: Default hostname to machine name rather than localhost

Jonas Smedegaard js at moszumanska.debian.org
Tue Apr 29 11:59:46 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 eedaf6af336a21eeabcb94ea5fe8da43be76bff3
Author: Mark Wubben <mark at novemberborn.net>
Date:   Tue Sep 13 14:45:15 2011 +0100

    Default hostname to machine name rather than localhost
---
 index.js | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/index.js b/index.js
index 2606926..cd43e55 100644
--- a/index.js
+++ b/index.js
@@ -2,6 +2,8 @@ var dgram = require('dgram');
 var Buffer = require('buffer').Buffer;
 var nodeConsole = console;
 
+var OsHostname = require("os").hostname();
+
 var Facility = {
     kern:   0,
     user:   1,
@@ -105,7 +107,7 @@ function SysLogger() {
  * Init function. All arguments is optional
  * @param {String} tag By default is __filename
  * @param {Facility|Number|String} By default is "user"
- * @param {String} hostname By default is "localhost"
+ * @param {String} hostname By default is require("os").hostname()
  */
 SysLogger.prototype.set = function(tag, facility, hostname, port) {
     this.setTag(tag);
@@ -127,7 +129,7 @@ SysLogger.prototype.setFacility = function(facility) {
     return this;
 };
 SysLogger.prototype.setHostname = function(hostname) {
-    this.hostname = hostname || 'localhost';
+    this.hostname = hostname || OsHostname;
     return this;
 };
 

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