| Conditions | 1 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | public static function createErrbitHandler( string $projectId, string $projectKey, string $host, string $environment = 'dev', ?string $level = LogLevel::DEBUG, bool $bubble = true ): HandlerInterface { |
||
| 16 | $notifier = new Notifier( [ |
||
| 17 | 'projectId' => $projectId, |
||
| 18 | 'projectKey' => $projectKey, |
||
| 19 | 'host' => $host, |
||
| 20 | 'environment' => $environment |
||
| 21 | ] ); |
||
| 22 | |||
| 23 | // Wrap errbit handler in SupportHandler to avoid logception (logger trying to log logging errors) when errbit throws an error |
||
| 24 | return new SupportHandler( |
||
| 25 | new AirbrakeHandler( $notifier, Logger::toMonologLevel( $level ?? LogLevel::DEBUG ), $bubble ), |
||
| 26 | new Logger( 'errbit errors', [ new ErrorLogHandler( ErrorLogHandler::OPERATING_SYSTEM, LogLevel::ERROR ), ] ), |
||
| 27 | ); |
||
| 31 |