fslogger

2019-12-02

fslogger是什么

什么是fslogger,Write data to log files

fslogger使用教程帮助文档

FsLogger

Write some logs to the file system bro.

Installation

npm install fslogger --save

Usage


You can work with process specific logfiles by specifying a prefix

var fslogger = new FsLogger(logdir, prefix);

You can adjust the log level by .setLogLevel()

fslogger.setLogLevel(3);

Setting the log level of 1 means that anything that is logged at 2 or greater will not be written to the log file

Log levels:

  • none: 0
  • error: 1
  • warn: 2
  • info: 3
  • debug: 4
  • trace: 5

Write to the log file with the following method

fslogger.log(loglevel, timestamp, message);

Use fslogger.write() in order to write a preformatted message to the log file

fslogger.write(message);

Delete old log files

FsLogger.prototype._deleteOldFiles(tmpdir,
function(err) {
  if (err) {
    return console.log(err.message);
  }
});

上一篇:stably
下一篇:storjshare-daemon
相关文章
暂无相关文章

首次访问,人机识别验证

扫描下方二维码回复 1024 获取验证码,验证完毕后 永久 无须验证

操作步骤:[打开微信]->[扫描上侧二维码]->[关注 FedJavaScript 的微信] 输入 1024 获取验证码

验证码有误,请重新输入