forked from koderhut/onelog-bundle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Joao Jacome
committed
Sep 20, 2018
1 parent
aac914a
commit 021b7ba
Showing
9 changed files
with
56 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace KoderHut\OnelogBundle\Middleware; | ||
|
||
use KoderHut\OnelogBundle\ContextualInterface; | ||
|
||
/** | ||
* Class SimpleMessageProcessor | ||
* | ||
* @author Joao Jacome <[email protected]> | ||
*/ | ||
class SimpleMessageProcessor implements MiddlewareInterface | ||
{ | ||
/** | ||
* @param string $level | ||
* @param mixed $message | ||
* @param array $context | ||
* | ||
* @return array | ||
*/ | ||
public function process($level, $message, $context): array | ||
{ | ||
if ($message instanceof \Throwable) { | ||
$message = $message->getMessage(); | ||
} | ||
|
||
return [$message, $context]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,14 +3,15 @@ | |
namespace KoderHut\OnelogBundle\Middleware; | ||
|
||
use KoderHut\OnelogBundle\ContextualInterface; | ||
use KoderHut\OnelogBundle\MiddlewareProcessor; | ||
|
||
/** | ||
* Class StackTraceProcessor | ||
* | ||
* @author Joao Jacome <[email protected]> | ||
*/ | ||
class StackTraceProcessor implements MiddlewareInterface | ||
{ | ||
{ | ||
/** | ||
* @param string $level | ||
* @param mixed $message | ||
|
@@ -24,7 +25,6 @@ public function process($level, $message, $context): array | |
$context = array_merge($context, [ | ||
'stack_trace' => $message->getTraceAsString(), | ||
]); | ||
$message = $message->getMessage(); | ||
} | ||
|
||
return [$message, $context]; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters