level = Logger::toMonologLevel($level); $introspection->addClasses(array('Monolog\\')); $this->introspection = $introspection; } public function __invoke(array $record) { // return if the level is not high enough if ($record['level'] < $this->level) { return $record; } // we should have the call source now $record['extra'] = array_merge( $record['extra'], $this->introspection->getRecord() ); return $record; } }