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

lark-log

Package Overview
Dependencies
Maintainers
3
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lark-log

Stream logging tool

  • 2.6.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
3
Created
Source

lark-log

This is Lark.js log module.

NPM version build status Test coverage NPM downloads Node.js dependencies

Useage

sample

const LarkLogger = require('lark-log');

const logger = new LarkLogger({ 'using-default': true });

logger.notice("Hello");

configure


const LarkLogger = require('lark-log');

const logger = new LarkLogger();

const config = {
    {
    "@description": "This is the default config",
    "level": 1,
    "methods": {
        "debug": {
            "level": 1,
            "output": "console"
        },
        "print": {
            "level": 2,
            "output": "console"
        },
        "trace": {
            "level": 2,
            "output": "system"
        },
        "notice": {
            "level": 3,
            "output": "system"
        },
        "warn": {
            "level": 4,
            "output": "system"
        },
        "error": {
            "level": 5,
            "output": "error"
        },
        "fatal": {
            "level": 5,
            "output": "error"
        }
    },
    "outputs": {
        "default": {
            "line-max-length": 2000,
            "format": "<%= method.toUpperCase() %>:\t<%= date('yyyy-mm-dd HH:MM:ss')%>\t<%= content %>",
            "path-prefix": "logs/",
            "path-suffix": ".log"
        },
        "console": null,
        "system": {
            "path": "system"
        },
        "error": {
            "path": "system",
            "path-suffix": ".log.wf"
        }
    }
};

logger.configure(config);

logger.debug('debug');// write "debug " to terminal
logger.notice('notice');// write "NOTICE: {DATETIME} notice" to system.log, {DATETIME} is in "yyyy-mm-dd HH:MM:ss" style
logger.error('error');//write to system.log.wf

logrotate

logger.configure({
    "outputs": {
        "default": {
            "path-suffix": ".log.<%= date('yyyymmddHH') %>"
        }
    }
});
  • If '<%' exists in path (including prefix and suffix), the path will be regarded as a dynamic path. LarkLog calculates the path every when an output came.

Keywords

FAQs

Package last updated on 25 Apr 2018

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