1.0.3 • Published 2 years ago
backend-log v1.0.3
Backend-Log
A simple logging utility for Node.js applications.
Installation
npm install backend-logUsage
Import the Console class from the package and use its static methods for logging:
const { Console } = require("backend-log");
// Log an info message
Console.info("Info message");
// Log a payload message
Console.payload("Payload message");
// Log an error message
Console.error("Error message");Configuration
Set the LOG_LEVEL environment variable to control the log output:
OFF: Disable logging.ERROR: Log error messages only.WARNING: Log error and payload messages.- Any other value: Log all messages.
export LOG_LEVEL=ERROR