https://github.com/dfirebaugh/log-donkey
a simple logging tool that logs based on a set log level
https://github.com/dfirebaugh/log-donkey
Last synced: 11 months ago
JSON representation
a simple logging tool that logs based on a set log level
- Host: GitHub
- URL: https://github.com/dfirebaugh/log-donkey
- Owner: dfirebaugh
- License: mit
- Created: 2019-12-07T18:23:27.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-05T02:32:43.000Z (over 3 years ago)
- Last Synced: 2025-05-18T09:37:40.770Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 716 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# logDonkey
a simple logging tool that logs based on a set log level
### install
``` npm i log-donkey ```
### example
```javascript
const log = require("log-donkey");
// set the log level
log.setLogLevel(log.levels.DEBUG);
// log an error
log.error("this is an error message");
// log a warning
log.warn("this is a warning message");
// log info
log.info("logging some info");
// log a debug message
log.debug("this is a debug message");
```
### es6 module example
```javascript
import log from "log-donkey"
log.setLogLevel(log.levels.DEBUG);
log.debug("some debug message here")
```
### LogLevels
```
ERROR - prints ERROR
WARN - prints ERROR and WARN
INFO - prints INFO, WARN, and ERROR
DEBUG - prints DEBUG, INFO, WARN, and ERROR
```