Registry / observability / eazy-logger

eazy-logger

JSON →
library4.1.0jsnpmunverified

eazy-logger is a lightweight command-line interface (CLI) logging utility designed for Node.js environments. It provides basic logging levels (debug, info, warn, error) and supports `printf`-style string substitution for dynamic message formatting. A key feature is its integration with `tfunk` for customizable, colorful console output, allowing developers to define prefixes and style messages with various colors. The current stable version is 4.1.0, released over a year ago. The project is in maintenance mode, with minimal activity primarily focused on critical fixes rather than new feature development, as indicated by its 'Inactive' status on Snyk. Its primary differentiators are its simplicity and built-in support for styled terminal output without external color libraries.

npm install eazy-logger
INSTALL
IMPORT
SIG · EAZY-LOGGER
E
eazy-logger
observabilityjavascriptv4.1.0
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Logger
✓ const { Logger } = require('eazy-logger');
✗ import { Logger } from 'eazy-logger';
This package is CommonJS-only and does not support ES module `import` syntax. The Logger class is accessed as a property of the main module export.
logger
✓ const logger = require('eazy-logger').Logger({ /* config */ });
✗ import logger from 'eazy-logger';
The primary way to instantiate a logger is by calling the `Logger` factory method directly on the `require('eazy-logger')` return value.
eazyLogger
✓ const eazyLogger = require('eazy-logger'); const logger = eazyLogger.Logger({ /* config */ });
✗ import * as eazyLogger from 'eazy-logger';
For CommonJS, the entire module can be `require`d, and the `Logger` factory method is then accessed as a property of the imported object.

Demonstrates initializing the logger with a custom prefix and level prefixes, then using various log levels, string substitution, and setting options for a single log statement.

const { Logger } = require('eazy-logger'); const logger = Logger({ prefix: "{blue:[}{magenta:easy-logger}{blue:] }", useLevelPrefixes: true }); console.log('--- Standard Loggers ---'); logger.debug("Debugging Msg"); logger.info("Info statement"); logger.warn("A little warning with string %s", "substitution"); logger.error("An error occurred in file: {red:%s}", "/users/awesomedev/file.js"); console.log('\n--- String Substitution + Colours ---'); logger.log("error", "Use {green:built-in} %s", "String substitution"); console.log('\n--- Set Option for Next Log Only ---'); logger.setOnce("useLevelPrefixes", false).warn("This warning will not have a level prefix."); logger.info("This info statement will use prefixes again.");
Debug
Known issues
breakingThe package is CommonJS-only and will not work directly with ES module `import` syntax in modern Node.js environments unless transpiled or dynamically imported. Attempting to `import` it will result in a runtime error.
fix
Ensure your project is configured for CommonJS, or use `const { Logger } = require('eazy-logger');` within an ES module via dynamic `await import('eazy-logger')` if applicable. For new projects, consider a modern logger with native ESM support.
affects: All versions
gotchaThe project is in 'inactive' maintenance mode, meaning new features are unlikely, and compatibility with future Node.js versions or emerging JavaScript standards (like native TypeScript support) may not be guaranteed. While a security fix was applied recently, ongoing proactive maintenance is limited.
fix
Evaluate the long-term viability for new projects. For existing projects, be aware that future breaking Node.js changes might not be addressed.
affects: >=4.1.0
gotchaThere are no official TypeScript type definitions shipped with the package, nor are there community-maintained types on `@types/eazy-logger`. This leads to type errors when used in TypeScript projects.
fix
Create a custom declaration file (e.g., `eazy-logger.d.ts`) to provide type information for the `Logger` class and its methods. An example would be `declare module 'eazy-logger' { class Logger { constructor(options: any); debug(...args: any[]): void; info(...args: any[]): void; warn(...args: any[]): void; error(...args: any[]): void; log(level: string, ...args: any[]): void; setOnce(key: string, value: any): Logger; } export { Logger }; }`
affects: All versions
Errors
Common errors & fixes
ReferenceError: require is not defined in ES module scope
Attempting to use `require()` in a JavaScript file that Node.js treats as an ES module (e.g., due to `"type": "module"` in `package.json` or a `.mjs` file extension).
fix
Either convert your project to CommonJS (remove `"type": "module"`), rename the file to `.cjs`, or use dynamic import with `const eazyLogger = await import('eazy-logger'); const { Logger } = eazyLogger;`.
Property 'Logger' does not exist on type 'typeof import("/path/to/node_modules/eazy-logger/index")'.
This error occurs in TypeScript when the `eazy-logger` package is imported without type definitions, and TypeScript cannot infer the structure of the module export.
fix
Create a `eazy-logger.d.ts` declaration file in your project to define the module's structure and the `Logger` class. See the 'Warnings' section for a basic example.
Upgrade
Version history
4.1.0latest on npm
Audit
Dependencies
tfunkrequiredProvides color and styling capabilities for log output.
Agent activity
24 hits · last 30 days
node
22
OpenAI (training)
2
Resources
eazy-logger — npm install eazy-logger · libregistry