1.1.5 • Published 8 years ago

mylogger v1.1.5

Weekly downloads
39
License
NONE
Repository
github
Last release
8 years ago

mylogger

This module enables you to create logging based on console

Setting up

npm install mylogger

Usage

Input

// Patch console.x methods in order to add timestamp information
var logger = require("mylogger");
logger.setLevel('debug');// either of 'log', 'debug', 'info', 'notice', 'warn', 'error'
//logger.setLogPath('/var/log/testLog.txt'); //optional, if not set it will pipe to stdout
//use either setLogPath or useRotate
logger.useRotate({
    dir: "/var/log",
    fileName: "test.log",
    rotateType: "minute", //minute/day/week/month/year
    dateFormat: "yyyymmddhhMM",// a valid date format. For more see https://www.npmjs.com/package/dateformat Date formate will prepend on filename
    useNewDir: true //if it is true there will be separate dir instead of appending on filename
});
logger.log("Hello", 'world');
logger.info("iiiiiiii", {txt: ['dummy']}, 'world');
logger.error("EEEEE", 'world')
logger.warn("ww", 'world')
logger.log("Hello World!", 'world');

Output

2015-11-26 15:24:02 [INFO] iiiiiiii { txt: [ 'dummy' ] } world
2015-11-26 15:24:02 [ERROR] EEEEE world
2015-11-26 15:24:02 [WARN] ww world
1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.9

9 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago