2.6.8 • Published 7 years ago

lark-log v2.6.8

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

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.
2.6.8

7 years ago

2.6.7

7 years ago

2.6.6

7 years ago

2.6.5

7 years ago

2.6.4

7 years ago

2.6.3

7 years ago

2.6.2

7 years ago

2.6.1

7 years ago

2.6.0

7 years ago

2.5.1

8 years ago

2.5.0

8 years ago

2.4.1

8 years ago

2.4.0

8 years ago

2.3.0

8 years ago

2.2.1

8 years ago

2.2.0

9 years ago

2.1.1

9 years ago

2.1.0

9 years ago

2.0.7

9 years ago

2.0.6

9 years ago

2.0.5

9 years ago

2.0.4

9 years ago

2.0.2

10 years ago

2.0.1

10 years ago

2.0.0

10 years ago

1.3.0

10 years ago

1.2.10

10 years ago

1.2.9

10 years ago

1.2.8

10 years ago

1.2.7

10 years ago

1.2.5

10 years ago

1.2.4

10 years ago

1.2.3

10 years ago

1.2.2

10 years ago

1.2.0

10 years ago

1.1.2

10 years ago

1.1.1

10 years ago

1.1.0

10 years ago

1.0.0

10 years ago

0.2.0

10 years ago

0.1.5

10 years ago

0.0.0

10 years ago