Skip to content

Prismlog is a beautiful, structured, and colorful logger for Node.js applications. It provides an expressive and flexible API to log messages with various colors, styles, and structured formats.

License

Notifications You must be signed in to change notification settings

micropack-tools/prismlog

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PrimeLogger

PrimeLogger is a beautiful, structured, and colorful logger for Node.js applications. It provides an expressive and flexible API to log messages with various colors, styles, and structured formats.

Features

  • Built-in support for colorful and styled console logs using Chalk
  • Fluent API with chaining for colors, background colors, and styles
  • Automatic detection and pretty printing of arrays and objects, including table-like display using console.table
  • Labels and timestamps for structured logging
  • Configurable logging levels and themes

Installation

npm install primelogger

Usage

Import the logger and use its fluent API:

import logger from 'primelogger';

logger.color('magenta').info('This message is magenta!');
logger.success('Operation completed successfully!');
logger.warn('This is a warning message.');
logger.error('An error occurred!');

// Log an array or array of objects to display as a table
const tableData = [
  { Name: 'Alice', Age: 30, City: 'New York' },
  { Name: 'Bob', Age: 25, City: 'Los Angeles' },
];
logger.info(tableData);

The logger automatically detects if the message is an array or an array of plain objects and uses console.table to display it in a structured table format.

Development

Clone the repository and install dependencies:

npm install

Run the demo:

ts-node src/example/demo.ts

Acknowledgements

Special thanks to the Chalk package for providing the colorful and styled console output capabilities that PrimeLogger leverages.

Author

Raj Sharma
Email: [email protected]
GitHub: https://github.com/rjsharma/primelogger

License

MIT License

About

Prismlog is a beautiful, structured, and colorful logger for Node.js applications. It provides an expressive and flexible API to log messages with various colors, styles, and structured formats.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%