Skip to content

Latest commit

 

History

History
115 lines (69 loc) · 1.67 KB

README.md

File metadata and controls

115 lines (69 loc) · 1.67 KB

Log.js

A logger that you can utilise within your projects

Instructions

Instalation

First install the module

npm install log-dot-js

Then add this code snippet to your file

const log = require('log-dot-js')

Print

This is used to simply print a message along with your local time next to it without any color

Usage:

log.print("Your message");

Output:

Screenshot

Info

This is used to display any sort of information you would like the user to know about

Usage:

log.info("Some information");

Output:

Screenshot

Success

This is used to show the user a task has been succesfully completed

Usage:

log.success("Some operation completed successfully");

Output:

Screenshot

Warning

This is used to display a warning

Usage:

log.warn("Some warning");

Output:

Screenshot

Message

Use this to display any message. This gets the message from the specified url.

var log = require('log-dot-js');
log.message("yoururlhere.domain");

Write File

Use this to store logs in a file.
The text is kept in a file and is overrun once the app is started again
You can use this multiple times within the file .

Usage:

log.writeFile("Info that you want to store");

Welcome

Use this for a welcome message.
It will get your project name and version from the package.json.
If you do not have a package.json file it will produce an error.

Usage:

log.welcome();

Output

Screenshot