@adenin/cf-logger

1.7.1 • Public • Published

Cloud Function Filtered Logger

A lightweight wrapper for console with added timestamp, log level indicator, and styling - for use with adenin cloud functions.

Installation

Use npm:

npm install @adenin/cf-logger

Usage

A file which wishes to use the logger simply needs to import it, then use its methods, as follows:

const logger = require('@adenin/cf-logger');

const msg = 'Hello world!';

logger.log(msg);
logger.info(msg);
logger.warn(msg);
logger.debug(msg);
logger.error(msg);

If NODE_ENV=development, all statements will be logged, if NODE_ENV=production, only error statements will be logged.

Dependencies (2)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @adenin/cf-logger

    Weekly Downloads

    1

    Version

    1.7.1

    License

    none

    Unpacked Size

    2.79 kB

    Total Files

    3

    Last publish

    Collaborators

    • intranetfactory
    • olliejm