diff --git a/lib/winston-syslog.js b/lib/winston-syslog.js index 5b1e9f0..f902d09 100644 --- a/lib/winston-syslog.js +++ b/lib/winston-syslog.js @@ -10,7 +10,7 @@ const dgram = require('dgram'); const net = require('net'); const secNet = require('tls'); const utils = require('./utils'); -const glossy = require('glossy'); +const glossy = require('@myndzi/glossy'); const winston = require('winston'); const Transport = require('winston-transport'); const { MESSAGE, LEVEL } = require('triple-beam'); diff --git a/package-lock.json b/package-lock.json index 50b8a72..a72ee12 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,11 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@myndzi/glossy": { + "version": "0.1.11", + "resolved": "https://registry.npmjs.org/@myndzi/glossy/-/glossy-0.1.11.tgz", + "integrity": "sha512-xQibh2ACY3e/nlV9400+4kc+fs2S5HIDb+3+ZyzFcWWTG9jx35Z6cgZWDbPE9DitOQp9n1UAQNOWlYESzfOZuA==" + }, "@sinonjs/commons": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.7.0.tgz", @@ -812,11 +817,6 @@ "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true }, - "glossy": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/glossy/-/glossy-0.1.7.tgz", - "integrity": "sha1-dptZhKlvYGarnqdYIkgl7mwhDws=" - }, "graceful-fs": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", diff --git a/package.json b/package.json index 122347c..3e75d9d 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "syslog" ], "dependencies": { - "glossy": "^0.1.7" + "@myndzi/glossy": "^0.1.11" }, "optionalDependencies": { "unix-dgram": "2.0.3" diff --git a/test/format-test.js b/test/format-test.js index ca1a5f7..8d206e3 100644 --- a/test/format-test.js +++ b/test/format-test.js @@ -4,7 +4,7 @@ const vows = require('vows'); const assert = require('assert'); const Syslog = require('../lib/winston-syslog.js').Syslog; const dgram = require('dgram'); -const parser = require('glossy').Parse; +const parser = require('@myndzi/glossy').Parse; const PORT = 11229; let server; @@ -69,7 +69,7 @@ vows assert.notEqual(msg.host, 'localhost'); transport.close(); }, - 'setting appName option to hello': { + 'setting appName option to hello and type to 5424': { 'topic': function () { const self = this; server.once('message', function (msg) { @@ -93,6 +93,14 @@ vows }, 'should have appName field set to hello': function (msg) { assert.equal(msg.appName, 'hello'); + }, + 'should have proper time zone': function (msg) { + const now = new Date(); + assert.equal((Math.abs((now - msg.time) / 1000) < 300), true); + }, + 'should have proper milliseconds format': function (msg) { + const milliseconds = msg.originalMessage.split(' ')[1].slice(20, 23); + assert.equal(isNaN(milliseconds), false); transport.close(); }, 'setting app_name option to hello': { diff --git a/test/unix-connect-test.js b/test/unix-connect-test.js index 7c04e4a..7d0fb8b 100644 --- a/test/unix-connect-test.js +++ b/test/unix-connect-test.js @@ -4,7 +4,7 @@ const fs = require('fs'); const vows = require('vows'); const assert = require('assert'); const unix = require('unix-dgram'); -const parser = require('glossy').Parse; +const parser = require('@myndzi/glossy').Parse; const Syslog = require('../lib/winston-syslog').Syslog; const { MESSAGE, LEVEL } = require('triple-beam');