Skip to content

Colors incorrect #16

@thekid

Description

@thekid

Info is being displayed in red, debug in black on white background when using the ColoredConsoleAppender class.

The bug was introduced in a7ab39ea and is inside the constructor, line 35:

$this->colors= array_merge(self::$DEFAULTS, $colors);

The problem is that array_merge() will renumber the keys of the array (which is stated in the manual), but we're using the loglevels, which are non-continuously-numbered integers, as keys:

$ xp -d 'array_merge([8 => "eight"], [1 => "one"])'
array(2) {
  [0]=>
  string(5) "eight"
  [1]=>
  string(3) "one"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions