diff --git a/README.md b/README.md index a9f20c4..c23970f 100644 --- a/README.md +++ b/README.md @@ -22,27 +22,25 @@ If you need a logger, you can use the interface like this: ```php logger = $logger; - } + $this->logger->info('Doing work'); - public function doSomething() - { - if ($this->logger) { - $this->logger->info('Doing work'); - } - try { $this->doSomethingElse(); - } catch (Exception $exception) { - $this->logger->error('Oh no!', array('exception' => $exception)); + } catch (Throwable $e) { + $this->logger->error('Oh no!', ['exception' => $e]); } // do something useful