77-node-logger 中文文档教程
77 Node Logger
这实际上只是一个超级简单的 fs 日志记录类。
const { Logger, CSVLogger } = require("77-node-logger");
const log = new Logger("test");
log.add("This is an example log!");
log.end()
const csvLog = new CSVLogger("csv", ["Title", "Name", "Date"]);
csvLog.add(["Test Title", "Test Name", "Test Date"])
csvLog.end();
这将在 ./logs/test.txt 中写入日志文件,日志为 This is an example log!
。
这还将在 ./logs/csv.csv 中写入一个 csv 文件
77 Node Logger
This is really just a super simple fs logging class.
const { Logger, CSVLogger } = require("77-node-logger");
const log = new Logger("test");
log.add("This is an example log!");
log.end()
const csvLog = new CSVLogger("csv", ["Title", "Name", "Date"]);
csvLog.add(["Test Title", "Test Name", "Test Date"])
csvLog.end();
This will write a log file in ./logs/test.txt with a log of This is an example log!
.
This will also write a csv file in ./logs/csv.csv
更多