You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 2, 2018. It is now read-only.
LoggerMixin adds capabilities to a LoopBack Next Application by adding a `.logger()` function that allows used to bind a Logger class to `Context` automatically. The binding key will be `loggers.${Class.name}` where `Class.name` is the name of the Logger class being bound. The Mixin also overrides existing `.component()` function so that components are also capable of providing Logger's to be bound automatically.
25
+
LoggerMixin adds capabilities to a LoopBack Next Application by adding a `.logger()` function that is used to bind a Logger class to `Context` automatically. The binding key will be `loggers.${Class.name}` where `Class.name` is the name of the Logger class being bound. Components are also able to provide their own Logger implementation which will be bound via `.component()` automatically when using this Mixin.
26
26
27
27
**Example**
28
28
```
@@ -57,7 +57,7 @@ class ColorLogger {
57
57
58
58
Once a Logger has been bound, you can retrieve it by using [Dependency Inject](http://loopback.io/doc/en/lb4/Dependency-injection.html)
59
59
60
-
**More Examples for binding a Logger**
60
+
#### More Examples for binding a Logger**
61
61
```
62
62
// Using the app's .logger() function.
63
63
class LoggingApplication extends LoggerMixin(Application) {
@@ -80,20 +80,3 @@ const app = new LoggingApplication({
80
80
components: [MyComponent] // Logger from MyComponent will be bound to loggers.ColorLogger
0 commit comments