{"library":"log-util","title":"Node.js Log Utility","description":"log-util is a minimalist Node.js logging utility designed for terminal output. It provides a simple API for common log levels such as debug, info, success, warn, and error, allowing developers to categorize and display messages with distinct visual feedback in the console. The current stable version is 2.3.0. The package appears to be in a maintenance or stable state, with its last publish date being approximately six years ago (as of April 2026), indicating a lack of recent active development or frequent feature additions. Its primary differentiator is its simplicity and small footprint, offering basic logging capabilities without the extensive configuration or advanced features found in more comprehensive logging frameworks. It ships with TypeScript type definitions, enabling a typed development experience for users.","language":"javascript","status":"maintenance","last_verified":"Sun Apr 19","install":{"commands":["npm install log-util"],"cli":null},"imports":["const log = require('log-util');","import log from 'log-util';","import type { LogUtil } from 'log-util';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import log from 'log-util';\n\n// Set the global log level to 'info'\nlog.setLevel('info');\n\nconsole.log('--- Default Logger (Level: Info) ---');\nlog.debug('This is a debug message (should not appear)');\nlog.info('This is an info message (level: 1)', { user: 'Alice' });\nlog.success('Operation completed successfully (level: 2)');\nlog.warn('A warning occurred (level: 3)');\nlog.error('An error happened (level: 4)', new Error('Something went wrong'));\n\n// Create a new Log instance with a custom level\n// The 'Log' constructor is exposed on the default 'log' object\nconst customLogger = new log.Log(log.levels.debug);\n\nconsole.log('\\n--- Custom Logger (Level: Debug) ---');\ncustomLogger.setLevel('debug'); // Set instance level to debug\ncustomLogger.debug('This is a debug message from custom logger (level: 0)');\ncustomLogger.info('Info from custom logger (level: 1)', [1, 2, 3]);\ncustomLogger.success('Success from custom logger (level: 2)');\n\n// Demonstrate changing level mid-execution\nconsole.log('\\n--- Changing Level on Default Logger ---');\nlog.setLevel('error');\nlog.info('This info message will not appear now.');\nlog.error('Only error messages will show (level: 4) after changing level.');\n","lang":"typescript","description":"Demonstrates importing `log-util`, setting the global log level, using various logging methods, and creating a separate `Log` instance with its own level.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}