Skip to content

Commit 0a4924c

Browse files
committed
patch: possibilité de désactiver un gestionnaire de log
1 parent 639b6f4 commit 0a4924c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Debug/Logger.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ public function __construct(bool $debug = BLITZ_DEBUG)
7171
$this->monolog = new MonologLogger(str_replace(' ', '-', $this->config->name ?? 'application'));
7272

7373
foreach (($this->config->handlers ?? []) as $handler => $options) {
74+
if (isset($options['active']) && $options['active'] === false) {
75+
continue;
76+
}
7477
$this->pushHandler($handler, (object) $options);
7578
}
7679

@@ -187,7 +190,7 @@ private function pushHandler(string $handler, stdClass $options)
187190
private function pushFileHandler(stdClass $options): void
188191
{
189192
$directory = rtrim($options->path ?: LOG_PATH, DS) . DS;
190-
$filename = strtolower($this->config->name ?: 'application');
193+
$filename = strtolower(str_replace(' ', '_', $this->config->name ?: 'application'));
191194
$extension = $options->extension ?: '.log';
192195

193196
if (($options->dayly_rotation ?: true) === true) {

0 commit comments

Comments
 (0)