Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hewer

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hewer - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

README.md

8

lib/formatters/formatters.js
var exports = module.exports = {}
exports.DefaultFormatter = function() {
this.format = (message, level, meta) =>
`${new Date().toISOString()} ${level} ${message} ${JSON.stringify(meta)}`;
this.format = (message, level, meta) => {
var tzoffset = (new Date()).getTimezoneOffset() * 60000;
var localISOTime = (new Date(Date.now() - tzoffset)).toISOString().slice(0,-1);
return `${localISOTime} ${level} ${message} ${JSON.stringify(meta)}`;
}
}
{
"name": "hewer",
"version": "0.1.0",
"version": "0.1.1",
"description": "A small and flexible logging library",

@@ -5,0 +5,0 @@ "repository": "https://github.com/matchs/hewer",

@@ -9,4 +9,4 @@ var assert = require('assert');

it('Should format the string correctly', function() {
assert.ok(formatter.format('SOME MESSAGE', 'WHATEVER', {"K":"V"}).match(/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}Z WHATEVER SOME MESSAGE .+K.+V/))
assert.ok(formatter.format('SOME MESSAGE', 'WHATEVER', {"K":"V"}).match(/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3} WHATEVER SOME MESSAGE .+K.+V/))
})
});

@@ -18,3 +18,3 @@ var assert = require('assert');

.then(function(msg) {
assert.ok(msg[0].match(/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}Z INFO .+"a":"1".+"b":"2".+"c":"3"/));
assert.ok(msg[0].match(/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3} INFO .+"a":"1".+"b":"2".+"c":"3"/));
done();

@@ -30,3 +30,3 @@ })

.then(function(msg) {
assert.ok(msg[0].match(/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}Z WARN .+"a":"1".+"b":"2".+"c":"3"/));
assert.ok(msg[0].match(/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3} WARN .+"a":"1".+"b":"2".+"c":"3"/));
done();

@@ -42,3 +42,3 @@ })

.then(function(msg) {
assert.ok(msg[0].match(/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}Z ERROR .+"c":"3"/));
assert.ok(msg[0].match(/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3} ERROR .+"c":"3"/));
done();

@@ -55,3 +55,3 @@ })

.then(function(msg) {
assert.ok(msg[0].match(/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}Z DEBUG .+"c":"3"/));
assert.ok(msg[0].match(/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3} DEBUG .+"c":"3"/));
done();

@@ -71,3 +71,3 @@ })

.then(function(msg) {
assert.ok(msg[0].match(/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}Z INFO .+ \{\}/))
assert.ok(msg[0].match(/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3} INFO .+ \{\}/))
done();

@@ -82,3 +82,3 @@ })

.then(function(msg) {
assert.ok(msg[0].match(/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}Z WARN .+ \{\}/))
assert.ok(msg[0].match(/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3} WARN .+ \{\}/))
done();

@@ -93,3 +93,3 @@ })

.then(function(msg) {
assert.ok(msg[0].match(/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}Z ERROR .+ \{\}/))
assert.ok(msg[0].match(/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3} ERROR .+ \{\}/))
done();

@@ -105,3 +105,3 @@ })

.then(function(msg) {
assert.ok(msg[0].match(/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}Z DEBUG .+ \{\}/))
assert.ok(msg[0].match(/[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3} DEBUG .+ \{\}/))
done();

@@ -108,0 +108,0 @@ })

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc