Skip to content

Commit 84df59d

Browse files
committed
Show integration with xp-framework/logging
1 parent 955091e commit 84df59d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ class Greet extends Handler {
5858
}
5959
```
6060

61+
The lambda's environment accessible via *$this->environment* is an Environment instance, see [below](https://github.com/xp-forge/lambda#environment).
62+
63+
6164
### Logging
6265

6366
To write output to the lambda's log stream, use *trace()*:
@@ -78,9 +81,7 @@ class Greet extends Handler {
7881
}
7982
```
8083

81-
Any non-string arguments passed will be converted to string using `util.Objects::stringOf()`.
82-
83-
The lambda's environment accessible via *$this->environment* is an Environment instance, see [below](https://github.com/xp-forge/lambda#environment).
84+
Any non-string arguments passed will be converted to string using `util.Objects::stringOf()`. To integrate with [XP logging](https://github.com/xp-framework/logging), pass the environment's writer to the console appender, e.g. by using `$cat= Logging::all()->toConsole($this->environment->writer)`.
8485

8586
Development
8687
-----------

0 commit comments

Comments
 (0)