-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add check is enabled in send massage #24
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. I've left some comments.
@@ -137,16 +143,28 @@ private function registerAssets() | |||
|
|||
public function captureMessage($message, $params, $levelOrOptions = [], $stack = false, $vars = null) | |||
{ | |||
if (!$this->enabled) { | |||
Yii::trace(Json::encode([$message, $params, $levelOrOptions]), __CLASS__); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yii::trace is deprecated, please use Yii::debug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All those who use Yii2.0.13 will not be able to use this extension. I propose to correct this problem, and only then do support 2.0.14
src/Component.php
Outdated
@@ -106,7 +112,7 @@ private function setRavenClient() | |||
} elseif (!is_object($this->client) || $this->client instanceof Closure) { | |||
$this->client = Yii::createObject($this->client); | |||
} | |||
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this trailing whitespace please.
src/Component.php
Outdated
@@ -137,16 +143,28 @@ private function registerAssets() | |||
|
|||
public function captureMessage($message, $params, $levelOrOptions = [], $stack = false, $vars = null) | |||
{ | |||
if (!$this->enabled) { | |||
Yii::trace(Json::encode([$message, $params, $levelOrOptions]), __CLASS__); | |||
return '-1'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
captureMessage normally returns the event id as a string, but it can also return null according to its doc.
We should also return null if the component is not enabled.
src/Component.php
Outdated
return $this->client->captureMessage($message, $params, $levelOrOptions, $stack, $vars); | ||
} | ||
|
||
public function captureException($exception, $culpritOrOptions = null, $logger = null, $vars = null) | ||
{ | ||
if (!$this->enabled) { | ||
Yii::trace(Json::encode([$message, $params, $levelOrOptions]), __CLASS__); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 there is no $message
, $params
and $levelOrOptions
variables.
If sentry module disabled and i call \Yii::$app->sentry->captureMessage