@derherrgammler/simple-file-logger v0.0.13
LogFile-Creator for Nodejs
An npm Modul for Node.js Log all your important messages in files to read them later.
Installation to Node dependency
- Make shure that you have
simple-file-logger
installed locally:
npm i @derherrgammler/simple-file-logger
- Require and usage:
var logger = require("@derherrgammler/simple-file-logger");
var sMessage = "This is the text that will be logged!";
var oOptions = {
// This is the Object with all settings for the specific log data
// For more information scroll down
"bConsole" : false,
"sFilename" : "mydata"
};
logger.log(sMessage, oOptions);
Option setting for logging
Every Option beginns with b
for boolean
or an s
for string
. This is the wanted input.
bConsole
: The log-Message will be shown in your console (Default: true
)
bFile
: The log-Message will be written into the file (Default: true
)
bLogDate
: The log-Message will get a log-Time (Default: true
)
sFilename
: You can change the filename for the logs. The Default has some presets for the choosen sType
. (Default: default
)
sExtansion
: This is the extention of your file. (Default: log
)
sPath
: The directory where the file will be placed. (Default: .tmp
)
sType
: The type of your log-Message. Presets are info
, warn
and error
but you can set also other values. (Default: default
)
sSeparator
: The separator between the bLogDate
the sType
and your message. (Default: ]-----[
)
Authors
- Felix Herold - DerHerrGammler
License
This project is licensed under the MIT License - see the LICENSE file for details