attrName)) $context['attrName'] = $this->attrName; if (!isset($context['tag']) && isset($this->tag)) $context['tag'] = $this->tag; $this->logs[] = [$type, $msg, $context]; } public function clear() { $this->logs = []; $this->unsetAttribute(); $this->unsetTag(); } public function getLogs() { return $this->logs; } public function setAttribute($attrName) { $this->attrName = $attrName; } public function setTag(Tag $tag) { $this->tag = $tag; } public function unsetAttribute() { unset($this->attrName); } public function unsetTag() { unset($this->tag); } public function debug($msg, array $context = []) { $this->add('debug', $msg, $context); } public function err($msg, array $context = []) { $this->add('err', $msg, $context); } public function info($msg, array $context = []) { $this->add('info', $msg, $context); } public function warn($msg, array $context = []) { $this->add('warn', $msg, $context); } }