New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

smarter-logger

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

smarter-logger

A Smart logger which provides way to manage concurrency to avoid load on server

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

Smarter Logger Node.JS library

Version Downloads

The Smarter Logger library provides way to run logger in smart way in your application to avoid extra load on server because of logging and finishesh logging task one by one. This add a chance of calling cloud logging when server is free from user's load.

Documentation

Requirements

Node 8, 10 or higher.

Installation

Install the package with:

npm install smarter-logger --save
# or
yarn add smarter-logger

Usage

const SmarterLogger = require('smarter-logger');

const yourLoggerMethod = (...args) => {
    return new Promise((resolve, reject) => {
        console.log('My logging', ...args);
        resolve();
    });
};

const logger = SmarterLogger(yourAsyncLoggerMethod, {
    concurrency: 2, // 2 log execution at a time (default = 1)
    retryCount: 1, // 1 times it will retry (default = 0)
});

// in your application, where you want to log
logger.log(arg1, arg2);

Or using ES modules and async/await:

import SmarterLogger from 'smater-logger';

const yourAsyncLoggerMethod = async (...args) => {
    console.log('My logging', ...args);
};

const logger = SmarterLogger(yourAsyncLoggerMethod, {
    concurrency: 2, // 2 log execution at a time (default = 1)
    retryCount: 1, // 1 times it will retry (default = 0)
});

// in your application, where you want to log
logger.log(arg1, arg2);

Usage with TypeScript

Import SmarterLogger as a default import (not * as SmarterLogger, unlike the DefinitelyTyped version) and call it as SmarterLogger() with the logger method and options.

import SmarterLogger from 'smater-logger';

const yourAsyncLoggerMethod = async (...args) => {
    console.log('My logging', ...args);
};

const logger = SmarterLogger(yourAsyncLoggerMethod, {
    concurrency: 2, // 2 log execution at a time (default = 1)
    retryCount: 1, // 1 times it will retry (default = 0)
});

// in your application, where you want to log
logger.log(arg1, arg2);

Development

Run all tests:

$ yarn install
$ yarn test

Run prettier:

Add an editor integration or:

$ yarn lint

Keywords

Logger

FAQs

Package last updated on 09 Jun 2025

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