log2file
v0.0.3-rfix
Published
Simple node file logging module
Readme
log2file
This is a simple module to save logs for your NodeJS application!
What's new in 0.0.3?
All functions are now chainable!
console.log('hello').warn('I am a warning!')Custom colored console logs.
Usage:
console.custom('Custom colored message', 'magenta') // Outputs magenta colored message in the consoleValid colors:
blackredyellowbluemagentacyanwhite
New option to use! See below.
How to use :
Install module using
npm install log2fileRequire the module
var logToFile = require('log2file')Initialize log2file
logToFile(options)optionsObject (required)logFileString : Name of the log file, defaults tologfile.logenableTimeBoolean : Sets whether the log should contain timelogToConsoleBoolean : Sets whether you want to show the log on console or just save it to the filebrightBoolean : Sets whether the console output should be bright or normal.
That's it! Use
console.log(),console.warn()andconsole.error()like you do always.
