UNPKG

1.56 kBMarkdownView Raw
1# @codedungeon/messenger
2
3## Description
4
5Messenger is a simple node module for display pretting console logs (with lots of formatting options) and support for logging messages to `.log` files (including daily rotation)
6
7## Install
8
9```bash
10> npm install @codedungeon/messenger
11```
12
13## Usage
14
15```js
16const msg = require("@codedungeon/messenger");
17const pkgInfo = require("./package.json");
18msg.initLogger(true, "logs", pkgInfo.name);
19
20console.log("");
21let showIcons = false;
22let showLabels = false;
23
24msg.critical("critical message", showLabels ? "CRITICAL" : "", showIcons);
25msg.error("error message", showLabels ? "ERROR" : "", showIcons);
26msg.success("success message", showLabels ? "SUCCESS" : "", showIcons);
27msg.warning("warning message", showLabels ? "WARNING" : "", showIcons);
28msg.important("important message", showLabels ? "IMPORTANT" : "", showIcons);
29msg.warn("warn message", showLabels ? "WARN" : "", showIcons);
30msg.notice("notice message", showLabels ? "NOTICE" : "", showIcons);
31msg.note("note message", showLabels ? "NOTE" : "", showIcons);
32msg.status("status message", showLabels ? "STATUS" : "", showIcons);
33msg.info("info message", showLabels ? "INFO" : "", showIcons);
34msg.debug("debug message", showLabels ? "DEBUG" : "", showIcons);
35```
36
37### License
38
39Copyright © 2019 Mike Erickson
40Released under the MIT license
41
42### Credits
43
44messenger written by Mike Erickson
45
46E-Mail: [codedungeon@gmail.com](mailto:codedungeon@gmail.com)
47
48Twitter: [@codedungeon](http://twitter.com/codedungeon)
49
50Webiste: [codedungeon.io](http://codedungeon.io)