UNPKG

lgfl

Version:

A lightweight Node.js library for file-based logging (Console.log and errors).

14 lines (11 loc) 259 B
const log = require("lgfl"); const consoleLog = log("./path/to/console.log"); consoleLog("Log message"); function onError(err) { log.onError(err, "./path/to/errors.log"); } try { // Your code that may generate an error } catch (err) { onError(err); }