Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@thetimes/logless

Package Overview
Dependencies
Maintainers
4
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@thetimes/logless

A simple logger

  • 1.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
17
increased by1600%
Maintainers
4
Weekly downloads
 
Created
Source

logless

Build Status Coverage Status npm version

About

Logless is a lightweight logging library specially crafted for serverless apps.

Install

npm install --save @thetimes/logless

Usage

const loggerFactory = require("@thetimes/logless");

const config = { logLevel: "debug" };

const log = loggerFactory(config, requestID);

log("something's up!");

Using a custom log function

By default logless uses console.log as a log function. But you can define your own by passing it as a config parameter:

const loggerFactory = require("@thetimes/logless");

const myCustomLogFunction = msg => process.stdout.write(msg);

const config = {
  logLevel: "warn",
  logFn: myCustomLogFunction
};

const log = loggerFactory(config, requestID);

log("something's up!");

API

Available log levels: silly|debug|verbose|info|warn|error

factory(config, requestId):

  • config (object): { logLevel, logFn }
    • logLevel (string): the level of logging. All levels below this will not be logged
    • logFn (function): custom log function (if ommited uses console.log)
  • requestId (string): the id of the request being logged

Returns a log function.

log(message):

  • message (string): the message to be logged

Returns void.

Contributing

See the CONTRIBUTING.md for a breakdown of the project

Keywords

FAQs

Package last updated on 26 Sep 2018

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