22declare(strict_types=1);
26use
function spl_object_id;
37 private array $attachments = [];
43 $this->attachments[spl_object_id($attachment)] = $attachment;
50 unset($this->attachments[spl_object_id($attachment)]);
54 $this->attachments = [];
58 return $this->attachments;
61 public function log($level, $message){
62 parent::log($level, $message);
63 foreach($this->attachments as $attachment){
64 $attachment($level, $message);
removeAttachment(\Closure $attachment)
addAttachment(\Closure $attachment)