Skip to content

Problem to write json on a file  #7

@akaiserg

Description

@akaiserg

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions