-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d35d48
commit e35d158
Showing
1 changed file
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,22 @@ | ||
# TrueLogger | ||
An advanced logger | ||
A lightweight logger with support for custom messages and timestamps. | ||
## How to use | ||
First you need to create a new instance of the logger with a **moment** timestamp format. | ||
```javascript | ||
const logger = new TrueLogger('HH:mm:ss'); | ||
``` | ||
To send a log message use one of these methods | ||
| Category | Tag | Tag Color | | ||
| ------------- |:-------------:| ----------:| | ||
| info | [I] | Grey | | ||
| warn | [W] | Yellow | | ||
| error | [E] | Red | | ||
| debug | [D] | Blue | | ||
The log methods also use the spread operator so you can do: | ||
```javascript | ||
logger.info('Spread','operator'); | ||
``` | ||
## Packages this project uses. | ||
I used moment and chalk for this project. The links are below. | ||
[Moment](https://www.npmjs.com/package/moment) | ||
[Chalk](https://www.npmjs.com/package/chalk) |