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

loglevel-timestamp

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

loglevel-timestamp

Prepends a timestamp to your loglevel messages with some extra :sparkle:

1.0.2
latest
Source
npm
Version published
Weekly downloads
1.2K
-0.43%
Maintainers
1
Weekly downloads
 
Created
Source

loglevel-timestamp

Prepends a timestamp to your loglevel messages with some extra ✨.

npm GitHub issues

Example

This can be used in node or in browser (see browser support).

prefixer(log, {
  shouldLevel: true,
  prefixStart: '[',
  prefixEnd: ']'
});

log.info('App started');

// [ 2016-08-19T17:31:00.230Z INFO ] App started

Options

  • shouldTimestamp

    Boolean - Default: true

    Use this to control if timestamp appears.

  • shouldLevel

    'Boolean' - Default: 'false'

    Use this to define if log level should be displayed.

    Example:

      2016-08-19T17:31:00.230Z INFO App started
    
  • prefixStart

    String - Default: none

    This gets appended before the prefix.

  • prefixEnd

    String - Default: none

    This gets appended after the prefix.

  • prefixes

    Array - Default: none

    This are items that are displayed after the timestamp and log level. You can use functions here.

Todo

  • Browser tests
  • Node tests
  • SemaphoreCI
  • Code climate
  • User defined functions with custom context
  • Reordering built-in prefixers in log

Browser support

This will not work in IE <=9!

Keywords

loglevel

FAQs

Package last updated on 01 Sep 2016

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