Comparing version
/** | ||
* TCG Logger | ||
* | ||
* @exports a singleton Bunyan log instance for logging use | ||
* Class for creating a Bunyan logger with some added goodies | ||
*/ | ||
@@ -62,3 +62,3 @@ | ||
class Logger extends Bunyan { | ||
constructor({logStream = 'debug', logFile = ''} = {}) { | ||
constructor({logStream = 'debug', logFile = '', logName = 'TCG Logger'} = {}) { | ||
// Add streams based on config | ||
@@ -85,3 +85,3 @@ const consoleDebugStream = { | ||
super({ | ||
name: 'TCG Logger', | ||
name: logName, | ||
streams: logStreams, | ||
@@ -88,0 +88,0 @@ serializers: { |
{ | ||
"name": "tcg-logger", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Bunyan Logger for TCG apps", | ||
"keywords": [ | ||
"log", | ||
"json", | ||
"logger", | ||
"middleware" | ||
], | ||
"keywords": [ | ||
"log", | ||
"json", | ||
"logger", | ||
"middleware" | ||
], | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"author": "Joe Furfaro", | ||
"license": "MIT", | ||
"engines": { | ||
"node": ">=7.0" | ||
}, | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/the-control-group/tcg-logger-express.git" | ||
}, | ||
"engines": { | ||
"node": ">=7.0" | ||
}, | ||
"dependencies": { | ||
@@ -24,0 +28,0 @@ "bunyan": "^1.8.5", |
@@ -1,2 +0,2 @@ | ||
# TCG Express Logger Module | ||
# TCG Logger Module for Express | ||
@@ -26,5 +26,11 @@ Built on [Bunyan](https://github.com/trentm/node-bunyan). Built-in Express middleware includes appending a child logger to each request and response times. | ||
const log = new Logger({ | ||
logStream: <'debug', 'json', or false>, // Debug for human readable logs to stdout, false to disable stdout, and json for ...well... json | ||
logFile: '/absolute/path/to/logfile' // Pass a string absolute path for logging to a file, leave empty to disable | ||
// Debug for human readable logs to stdout, false to disable stdout, and json for ...well... json | ||
logStream: <'debug', 'json', or false>, | ||
// Pass a string absolute path for logging to a file, leave empty to disable | ||
logFile: '/absolute/path/to/logfile', | ||
// Name to give the logger | ||
logName: 'TCG Logger' | ||
}); | ||
``` |
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
4114
5.62%36
20%0
-100%