A simple Node.Js module with configurable options.
npm install node-logger-simple
const { FileLogger } = require('node-logger-simple');
// personalised file is required
const logger = new FileLogger({
logFilePath: "my-log-file"
});
logger.logError('An error has occurred.');
logger.logInfo('Important information.');
logger.logSucces('Succes message.')
Initialize the Logger with the following options:
logFilePath
: Allows you to choose the file name.
logError('An error has occurred.')
- Logs an error message to the configured log file.logSucces('Succes message.')
- Logs an succes message to the configured log file.logInfo('Important information.')
- Logs an info message to the configured log file.