Skip to content

Commit 0c2c410

Browse files
committed
ICL: Final calling strategy picked.
1 parent 3b24c56 commit 0c2c410

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

src/Loggable.php

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,21 @@
99

1010
trait Loggable
1111
{
12-
public function run(InputInterface $input, OutputInterface $output)
12+
protected function initialize(InputInterface $input, OutputInterface $output)
1313
{
14-
// $type = $this->type();
15-
// $environment = app()->environment();
16-
// $path = storage_path("logs/cloud/{$type}/{$this->entity}/date.log");
17-
//
18-
// $handler = new RotatingFileHandler($path, 30);
19-
// $handler->setFilenameFormat('{date}', 'Y-m-d');
20-
// $log = new Logger($environment, [$handler]);
14+
$this->initializeLogging();
15+
}
16+
17+
protected function initializeLogging()
18+
{
19+
$type = $this->type();
20+
$environment = app()->environment();
21+
$path = storage_path("logs/cloud/{$type}/{$this->entity}/date.log");
22+
23+
$handler = new RotatingFileHandler($path, 30);
24+
$handler->setFilenameFormat('{date}', 'Y-m-d');
25+
$log = new Logger($environment, [$handler]);
2126

22-
return parent::run($input, $output);
27+
$log->info('Hello World!');
2328
}
2429
}

0 commit comments

Comments
 (0)