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

b-logger

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

b-logger

logger

  • 0.0.8
  • npm
  • Socket score

Version published
Weekly downloads
34
increased by277.78%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status MIT license

Usage

const {debug,error,warn,info } = require("b-logger")("logger.tag")
debug("debug")
error("error")

debug,error,warn,info are logger functions. logger.tag is a name of the four functions.

//logger function
(message:string,...params:any[])=>void

Configure

b-logger read json and config log4js.

  • current working directory/logger.json
  • start up script's director/logger.json

Example:

{
  "level": "debug",
  "error": {
    "path": "./log/error.log",
    "fileNamePattern": "-dd"
  },
  "warn": {
    "path": "./log/warn.log",
    "fileNamePattern": "-dd"
  },
  "info": {
    "path": "./log/info.log",
    "fileNamePattern": "-dd"
  },
  "debug": {
    "path": "./log/debug.log",
    "fileNamePattern": "-dd"
  },
  "options":{
    "console":{
      "exclude":[
        ".*"
      ],
      "include":[
        "^debug"
      ]
    }
  }
}

pattern see here

options

There are two fields in options at the monent,console and file represent two types of logger.

exclude is an array of RegExp string that used to specify which loggers will be excluded (output nothing to console) include is an array of regexp string also and it was used to specify which loggers will be included.

If no exclude and include fields ,all the log will be output. If a logger's name matchs exclude and include, it will be included

Keywords

FAQs

Package last updated on 28 Jul 2017

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