Skip to content

Commit 67f1fb7

Browse files
author
craigparra
committed
1.1.2 / 2021-07-19
================== * Updated README.md for boot - @craigparra
1 parent 558d963 commit 67f1fb7

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ package interface.
1515
<a name="usage">Usage</a>
1616
-------------------------
1717

18+
### Standalone
19+
1820
To use the module, import the LoggerFactory and call the `getLogger` function with a logging category (your module
1921
requires path is a sensible choice).
2022

@@ -42,6 +44,34 @@ following in your [config](https://www.npmjs.com/package/config) files.
4244
}
4345
```
4446

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+
4575
The logger supports the following levels by default, but is fully configurable.
4676

4777
```javascript

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@alt-javascript/logger",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"description": "A simple configurable logging facade for javascript.",
55
"author": "",
66
"keywords": [

0 commit comments

Comments
 (0)