Skip to content

Commit 968b968

Browse files
update
1 parent 270f8d0 commit 968b968

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Capsule/Logger.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ protected static function registerDefaultStyles(ConsoleOutput $output): void
6464
$f = $output->getFormatter();
6565

6666
$styles = [
67-
// existing
68-
'success' => ['bright-green', null, ['bold']],
69-
'error' => ['bright-red', null, ['bold']],
70-
'info' => ['bright-cyan', null, ['bold']],
67+
// existing (headers use white text on colored background)
68+
'success' => ['white', 'green', []],
69+
'error' => ['red', 'red', ['bold']],
70+
'info' => ['white', 'cyan', []],
7171

7272
// extras
7373
'yellow' => ['yellow', null, ['bold']],
@@ -85,7 +85,10 @@ protected static function registerDefaultStyles(ConsoleOutput $output): void
8585
];
8686

8787
foreach ($styles as $name => [$fg, $bg, $opts]) {
88-
if (!$f->hasStyle($name)) {
88+
// Force override for listed headers use white text on background.
89+
// Keep existing built-in styles (e.g., <error>) unless we need to change them.
90+
$shouldSet = in_array($name, ['info', 'success', 'error'], true) ? true : !$f->hasStyle($name);
91+
if ($shouldSet) {
8992
$f->setStyle($name, new OutputFormatterStyle($fg, $bg, $opts));
9093
}
9194
}

0 commit comments

Comments
 (0)