1.0.92 • Published 3 months ago

@kingdanx/litelogger v1.0.92

Weekly downloads
-
License
ISC
Repository
github
Last release
3 months ago

LiteLogger

Usage

For use in Nodejs to create daily logs with time stamps for your application.

To use:

Install the NPM package:

npm i @kingdanx/litelogger

Create a new LiteLogger object:

const logger = new LiteLogger(__dirname, "Test Dir", "Test Logs");
//The first argument is the name of the directory. 
//The second argument is the name of the folder you want your files in. It will be created if it does not exist
//The third argument is the name attached to the .log files

This logger object would create a directory and files that look like this: image

Call the log() method:

logger.log({ test: "test" }, "ERROR");
logger.log("test");
//The first argument is the message you want to log.
//The second argument is a string value that defines the message type. If not provided it will be of type INFO

Here is the expected output from the above code: image

If the log() function is called on a day for which no log file exists, a new file will be created to store all messages received on that day. If log() is called on a day that already has an associated file, the message will be appended to that file.

1.0.91

3 months ago

1.0.92

3 months ago

1.0.9

10 months ago

1.0.8

11 months ago

1.0.7

11 months ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago