logpp
logpp copied to clipboard
Problem to write json on a file
Hi, I tried to save a json into a file. First I did this:
const wstream = require("fs").createWriteStream("./scratchlog2.txt");
const logpp = require("logpp")("basic", { prefix: false, flushCount: 0, bufferSizeLimit: 0 , flushTarget: "stream", stream: wstream });
logpp.addFormat("Basic_Hello", "Hello World!!!");
logpp.info(logpp.$Basic_Hello);
And I could write on the file, but with this
const wstream = require("fs").createWriteStream("./scratchlog2.txt");
const logpp = require("logpp")("basic", { prefix: false, flushCount: 0, bufferSizeLimit: 0 , flushTarget: "stream", stream: wstream });
log.addFormat("Json", {kind: "start", time: "#wallclock", value: "%j"});
log.info(log.$Json, [1, 2]);
Nothing was written. Regards.