Socket
Socket
Sign inDemoInstall

log2file

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    log2file

Simple node file logging module


Version published
Weekly downloads
2
increased by100%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

log2file

This is a simple module to save logs for your NodeJS application!

What's new in 0.0.3?

  1. All functions are now chainable!

    console.log('hello').warn('I am a warning!')
    
  2. Custom colored console logs.

    Usage:

    console.custom('Custom colored message', 'magenta')
    // Outputs magenta colored message in the console
    

    Valid colors:

    • black
    • red
    • yellow
    • blue
    • magenta
    • cyan
    • white
  3. New option to use! See below.

How to use :

  1. Install module using npm install log2file

  2. Require the module

    var logToFile = require('log2file')
    
  3. Initialize log2file

    logToFile(options)

    • options Object (required)
      • logFile String : Name of the log file, defaults to logfile.log
      • enableTime Boolean : Sets whether the log should contain time
      • logToConsole Boolean : Sets whether you want to show the log on console or just save it to the file
      • bright Boolean : Sets whether the console output should be bright or normal.
  4. That's it! Use console.log(), console.warn() and console.error() like you do always.

MIT (c) Akash Rajendra

I was supposed to be studying for my exams, but no. I made this instead.

Keywords

FAQs

Last updated on 27 Aug 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