This npm package is designed to facilitate the creation and writing of log files in your application. We have included file locking mechanisms to ensure that multiple processes or threads cannot write to the same log file simultaneously, so you don't need to manage this yourself.
with syntaxic coloration :
const quicklog = require('quickfilelog')('logfile.txt', true);
without syntaxic coloration :
const quicklog = require('quickfilelog')('logfile.txt', false);
quicklog.writeInfo('this is a super info log')//write a info type
quicklog.writeWarning('this is a super warning log')//write a warning type
quicklog.writeError('this is a super error log')//write an error type
quicklog.erase()//flush your log file content
const logger = require("quickfilelog")("mylog.txt", true)
logger.writeInfo('this is a super info log')//write a info type
logger.writeWarning('this is a super warning log')//write a warning type
logger.writeInfo('this is a super error log')//write an error type
23/04/23 23h17m56s [INFO] this is a super info log
23/04/23 23h18m18s [WARNING] this is a super warning log
23/04/23 23h18m18s [ERROR] this is a super error log