Skip to content

Success/warning/etc messages are not shown after update to 1.3.0, if loglevel is info #33

@olelis

Description

@olelis

Hello,

after update to 1.3.0, all channels except info are not shown.

You can actually run examples/logging.php to see that only debug message will be shown.

I would expect that when you select logging level to "debug" to see all messages ,while if I set to emergency, then to see only "emergency" errors. Currently it works in the opposite way: Emergency shows everything, debug show only debug messages.

Reason is in this method:

  public function setLogLevel($level)
   {
       if (!isset($this->loglevel[$level])) $this->fatal('Unknown log level');
       $enable = true;
       foreach (array_keys($this->loglevel) as $l) {
           $this->loglevel[$l]['enabled'] = $enable;
           if ($l == $level) $enable = false;
       }
   }

Order of loglevels should be reversed, or $enabled should be false by default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions