Skip to content

Commit 3936731

Browse files
Dmitry TarasovDmitry Tarasov
authored andcommitted
Change logic for duplicated errors: send plain messages, but unset error object
1 parent a2162bd commit 3936731

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

src/Stackify/Log/Transport/AbstractApiTransport.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ public function __construct($apiKey, array $options = array())
2424
public function addEntry(LogEntryInterface $logEntry)
2525
{
2626
$logMsg = $this->messageBuilder->createLogMsg($logEntry);
27-
if ($this->errorGovernor->shouldBeSent($logMsg)) {
28-
$this->queue[] = $logMsg;
27+
if (!$this->errorGovernor->shouldBeSent($logMsg)) {
28+
$logMsg->Ex = null;
2929
}
30+
$this->queue[] = $logMsg;
3031
}
3132

3233
public function finish()

src/Stackify/Log/Transport/AgentTransport.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ public function __construct(array $options = array())
3333
public function addEntry(LogEntryInterface $logEntry)
3434
{
3535
$logMsg = $this->messageBuilder->createLogMsg($logEntry);
36-
if ($this->errorGovernor->shouldBeSent($logMsg)) {
37-
$data = $this->messageBuilder->getAgentMessage($logMsg);
38-
$this->send($data);
36+
if (!$this->errorGovernor->shouldBeSent($logMsg)) {
37+
$logMsg->Ex = null;
3938
}
39+
$data = $this->messageBuilder->getAgentMessage($logMsg);
40+
$this->send($data);
4041
}
4142

4243
public function finish()

0 commit comments

Comments
 (0)