Socket
Socket
Sign inDemoInstall

ec-logger

Package Overview
Dependencies
1
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ec-logger

Easy Console Logger for NodeJS Applications


Version published
Maintainers
1
Created

Readme

Source

ec-logger

NPM

What is this?*

ec-logger is an easy console logger module that adds timestamps and file logging to the regular console.log function.

Usage

// app.js
require('ec-logger')(console);

console.log("Hello, World!");
// output: [04:10:22 am] Hello, World!

Options / Settings


console.set('show time', false);        // Disables timestamps
console.set('time format', 'MM:ss a');  // moment.js timestamp format
console.set('time prefix', '(');        // Timestamp prefix
console.set('time suffix', ')');        // Timestamp suffix
console.set('log output', false);       // Disables file logging
console.set('log path', "/logs/foo.txt");   // Where to write the logs

Additional Notes

  • Please report any issues here

Keywords

FAQs

Last updated on 18 Oct 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc