Skip to content

Commit

Permalink
Rollbar updated to 1.3.1 (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
matjack1 authored and baibaratsky committed Aug 7, 2017
1 parent 51efd3b commit 693d8cd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion RollbarErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class RollbarErrorHandler extends CErrorHandler
{
protected function handleException($exception)
{
Rollbar::log(Level::error(), $exception);
Rollbar::log(Level::ERROR, $exception);

parent::handleException($exception);
}
Expand Down
6 changes: 4 additions & 2 deletions RollbarLogRoute.php
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
<?php

use Rollbar\Rollbar;
use Rollbar\Payload\Level;
use Rollbar\LevelFactory;

class RollbarLogRoute extends CLogRoute
{
public $rollbarComponentName = 'rollbar';
private $levelFactory = null;

public function init()
{
if (Yii::app()->getComponent($this->rollbarComponentName) === null) {
throw new CException('Rollbar component is not loaded.');
}
$this->levelFactory = new LevelFactory();
}

protected function processLogs($logs)
{
foreach ($logs as $log) {
// Exclude records by the exceptions handler. RollbarErrorHandler takes care of them.
if (strncmp($log[2], 'exception', 9) !== 0) {
Rollbar::log(Level::fromName($this->correspondingLevel($log[1])), $log[0]);
Rollbar::log($this->levelFactory->fromName($this->correspondingLevel($log[1])), $log[0]);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
],
"require": {
"php": ">=5.3",
"rollbar/rollbar": "~1.1.0"
"rollbar/rollbar": "~1.3.1"
}
}

0 comments on commit 693d8cd

Please sign in to comment.