Skip to content

Commit a50a2d1

Browse files
committed
#90 code review - update documentation & psr/log required version
1 parent bb3d308 commit a50a2d1

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

src/batch-symfony-framework/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"symfony/http-kernel": "^6.4|^7.0",
2020
"symfony/framework-bundle": "^6.4|^7.0",
2121
"yokai/batch": "^0.5.0",
22-
"psr/log": "^1.0|^2.0|^3.0"
22+
"psr/log": "^1.1|^2|^3"
2323
},
2424
"autoload": {
2525
"psr-4": {

src/batch-symfony-framework/docs/getting-started.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,15 +106,30 @@ The job launcher that will be injected depends on the packages you have installe
106106

107107

108108
## Use the batchLogger
109+
The aim of the batchLogger is to store log inside the jobExecution.
109110
In a symfony project, you can use the batchLogger with the symfony autowiring by naming your variable as `$yokaiBatchLogger`
110111

111112
```php
113+
<?php
114+
115+
namespace App;
116+
112117
use Psr\Log\LoggerInterface;
113118
114-
...
115-
__construct(private readonly LoggerInterface $yokaiBatchLogger) {
119+
final readonly class YourService
120+
{
121+
public function __construct(
122+
private LoggerInterface $yokaiBatchLogger,
123+
) {
124+
}
125+
126+
public function method()
127+
{
128+
$this->yokaiBatchLogger->error(...);
129+
}
116130
}
117131
```
132+
```
118133

119134
## On the same subject
120135

0 commit comments

Comments
 (0)