- Node: v6.10.3
- NPM: 3.10.10
npm ls --depth 1
[email protected] /home/henrique/development/revmobads/proxy-geo-router
├── @istanbuljs/[email protected]
├─┬ [email protected]
diff --git a/logger.js b/logger.js | |
index 3aa3418..d19e435 100644 | |
--- a/logger.js | |
+++ b/logger.js | |
@@ -1,6 +1,41 @@ | |
const pino = require('pino'); | |
const { createNamespace } = require('cls-hooked'); | |
+const logMethods = ['trace', 'debug', 'info', 'warn', 'error', 'fatal']; | |
+ |
diff --git a/logger.js b/logger.js | |
index dbac73a..3aa3418 100644 | |
--- a/logger.js | |
+++ b/logger.js | |
@@ -1,9 +1,13 @@ | |
const pino = require('pino'); | |
const { createNamespace } = require('cls-hooked'); | |
+let counter = 0; | |
+ |
diff --git a/logger.js b/logger.js | |
index f78dff6..dbac73a 100644 | |
--- a/logger.js | |
+++ b/logger.js | |
@@ -1,7 +1,11 @@ | |
const pino = require('pino'); | |
+const { createNamespace } = require('cls-hooked'); | |
function createLogger(opts, destination) { | |
- return pino(opts, destination); |
diff --git a/logger.test.js b/logger.test.js | |
index 8f89251..a841156 100644 | |
--- a/logger.test.js | |
+++ b/logger.test.js | |
@@ -13,3 +13,19 @@ loggerMethodUseCases.forEach(({ input, expected }) => { | |
expected | |
); | |
}); | |
+ | |
+test(`Properly logs message with context object`, async t => { |
const pino = require('pino'); | |
function createLogger(opts, destination) { | |
return pino(opts, destination); | |
} | |
module.exports = createLogger; |
const express = require('express'); | |
const pino = require('pino'); | |
const cuid = require('cuid'); | |
const { createNamespace, getNamespace } = require('cls-hooked'); | |
const logger = pino(); | |
const loggerNamespace = createNamespace('logger'); | |
const app = express(); |
db.getMongo().getDBNames() | |
.filter(function(db) { | |
return ['admin', 'config', 'local'].indexOf(db) === -1 | |
}) | |
.forEach(function (dbName) { | |
db.getMongo().getDB(dbName).dropDatabase(); | |
}) | |
npm ls --depth 1
[email protected] /home/henrique/development/revmobads/proxy-geo-router
├── @istanbuljs/[email protected]
├─┬ [email protected]
// Originally from: http://exploringjs.com/es6/ch_generators.html#_example-processing-asynchronously-pushed-data | |
'use strict' | |
const createReadStream = require('fs').createReadStream | |
function coroutine(generatorFunction) { | |
return function (...args) { | |
const generatorObject = generatorFunction(...args); | |
generatorObject.next() | |
return generatorObject |
class BinaryTree { | |
constructor(value, left=null, right=null) { | |
this.value = value | |
this.left = left | |
this.right = right | |
} | |
} |