setLevel($level); // Removed the clearing of storage to allow appending, or we can keep it if strict behavior is needed. // The original code cleared it: // if (!empty($storage)) { $storage = []; } // I will keep the behavior of NOT clearing it, as per plan improvement, but wait, // the plan said "Improvement: Remove auto-clearing". $this->storage = &$storage; } protected function write(string $formatted): void { $this->storage[] = $formatted; } }