New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

filelogger

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

filelogger

Node.js module to log to the console and to a file, allowing for different log levels for both

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

Filelogger is a logging utility to allow logging to the console AND filesystem with differing log levels for each.

The default log levels are as follows:

  • debug
  • error
  • warn
  • info

For example, if you select "warn" for the console logging, everything below warn will be logged to the console (warn, info). Likewise, if you select "debug", all four levels will be logged.

Usage

The Logger class takes three elements:

  • fileLevel (debug -> info)
  • consoleLevel (debug -> info)
  • path (file path for the log)

var Logger = require("filelogger"),
    logger = new Logger("error", "info", "myLog.log");

To log, simply call logger.log() with the log level and message (can also be an object);

logger.log("info", "Foobar!");

logger.log("error", {message: "my error message"});

Keywords

logger

FAQs

Package last updated on 17 Sep 2015

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