1 | # @codedungeon/messenger
|
2 |
|
3 | ## Description
|
4 |
|
5 | Messenger 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
|
16 | const msg = require("@codedungeon/messenger");
|
17 | const pkgInfo = require("./package.json");
|
18 | msg.initLogger(true, "logs", pkgInfo.name);
|
19 |
|
20 | console.log("");
|
21 | let showIcons = false;
|
22 | let showLabels = false;
|
23 |
|
24 | msg.critical("critical message", showLabels ? "CRITICAL" : "", showIcons);
|
25 | msg.error("error message", showLabels ? "ERROR" : "", showIcons);
|
26 | msg.success("success message", showLabels ? "SUCCESS" : "", showIcons);
|
27 | msg.warning("warning message", showLabels ? "WARNING" : "", showIcons);
|
28 | msg.important("important message", showLabels ? "IMPORTANT" : "", showIcons);
|
29 | msg.warn("warn message", showLabels ? "WARN" : "", showIcons);
|
30 | msg.notice("notice message", showLabels ? "NOTICE" : "", showIcons);
|
31 | msg.note("note message", showLabels ? "NOTE" : "", showIcons);
|
32 | msg.status("status message", showLabels ? "STATUS" : "", showIcons);
|
33 | msg.info("info message", showLabels ? "INFO" : "", showIcons);
|
34 | msg.debug("debug message", showLabels ? "DEBUG" : "", showIcons);
|
35 | ```
|
36 |
|
37 | ### License
|
38 |
|
39 | Copyright © 2019 Mike Erickson
|
40 | Released under the MIT license
|
41 |
|
42 | ### Credits
|
43 |
|
44 | messenger written by Mike Erickson
|
45 |
|
46 | E-Mail: [codedungeon@gmail.com](mailto:codedungeon@gmail.com)
|
47 |
|
48 | Twitter: [@codedungeon](http://twitter.com/codedungeon)
|
49 |
|
50 | Webiste: [codedungeon.io](http://codedungeon.io)
|