New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@jodacame/node-logger

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jodacame/node-logger

A simple logger for Node.js

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
24
decreased by-29.41%
Maintainers
0
Weekly downloads
 
Created
Source

node-logger

node-logger

A lightweight and flexible logger for Node.js applications. Designed to simplify logging with support for different log levels, including info, error, warn, and debug. With node-logger, you can log directly to stdout, track progress with a progress bar, and include additional context as needed. Whether you're building a small project or a larger application, node-logger provides the essential tools for effective logging.

Installation

npm install @jodacame/node-logger

Basic Usage

const logger = require('@jodacame/node-logger');
or 
import logger from '@jodacame/node-logger';

logger.info('Hello world');
logger.error('Hello world');
logger.warn('Hello world');
logger.debug('Hello world');

logger.info('Hello world', { key: 'value' });
logger.error('Hello world', { key: 'value' });
logger.warn('Hello world', { key: 'value' });
logger.debug('Hello world', { key: 'value' });

Stdout Usage

Allow to log to stdout

const logger = require('@jodacame/node-logger');
or
import logger from '@jodacame/node-logger';

logger.stdout.info('Hello world');
logger.stdout.error('Hello world');
logger.stdout.warn('Hello world');
logger.stdout.debug('Hello world');

logger.stdout.info('Hello world', { key: 'value' });
logger.stdout.error('Hello world', { key: 'value' });
logger.stdout.warn('Hello world', { key: 'value' });
logger.stdout.debug('Hello world', { key: 'value' });

Progress Usage

Display progress bar

const logger = require('@jodacame/node-logger');
or
import logger from '@jodacame/node-logger';

logger.progress(value, [total], [barLength], [message]);

// Example:
logger.progress(50, 100, 100, 'Progress bar');
logger.progress(70);

Types of log

  • info
  • error
  • warn
  • debug
  • progress
  • stdout[info, error, warn, debug, progress]

Keywords

FAQs

Package last updated on 25 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc