File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ package interface.
15
15
<a name =" usage " >Usage</a >
16
16
-------------------------
17
17
18
+ ### Standalone
19
+
18
20
To use the module, import the LoggerFactory and call the ` getLogger ` function with a logging category (your module
19
21
requires path is a sensible choice).
20
22
@@ -42,6 +44,34 @@ following in your [config](https://www.npmjs.com/package/config) files.
42
44
}
43
45
```
44
46
47
+ ### @alt-javascript/boot
48
+
49
+ The LoggerSyntax is more fluent if you combine
50
+ [ @alt-javascript/boot ] ( https://www.npmjs.com/package/@alt-javascript/boot ) and
51
+ [ @alt-javascript/config ] ( https://www.npmjs.com/package/@alt-javascript/config ) to bind the LoggerFactory
52
+ to the global root context, freeing your sub-modules from requiring and injecting the config.
53
+
54
+ ` MyModule.js `
55
+ ``` javascript
56
+ const config = require (' @alt-javascript/config' );
57
+ const {LoggerFactory } = require (' @alt-javascript/logger' );
58
+ const {boot } = require (' @alt-javascript/boot' );
59
+ boot (config);
60
+
61
+ ```
62
+
63
+ Then in your application modules, you only need.
64
+
65
+ ` MyModule.js `
66
+ ``` javascript
67
+ const {LoggerFactory } = require (' @alt-javascript/logger' );
68
+
69
+ const logger = LoggerFactory .getLogger (' @myorg/mypackage/MyModule' );
70
+ logger .info (' Hello from MyModule!' )
71
+ ```
72
+
73
+ ### Log Levels
74
+
45
75
The logger supports the following levels by default, but is fully configurable.
46
76
47
77
``` javascript
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @alt-javascript/logger" ,
3
- "version" : " 1.1.1 " ,
3
+ "version" : " 1.1.2 " ,
4
4
"description" : " A simple configurable logging facade for javascript." ,
5
5
"author" : " " ,
6
6
"keywords" : [
You can’t perform that action at this time.
0 commit comments