Skip to content

Logging Function Suggestion #1

@cassitly

Description

@cassitly

The logging function mentioned in the readme file of NextLibrary, this is my suggestion for its implementation.

const fs = require("fs");

module.exports = class Logs {
  path: "...",
  filename: "fileLog.log",
}

module.exports = function log(text) {
  console.log(text);
  fs.writeFileSync(Logs.path + Logs.filename, text, "utf8");
}

The class command is an easy way for setting and changing values like file path and file names. The fs module is for writing files to the log

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions