mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-05 12:47:39 +02:00
Merge pull request #866 from p-golovin/patch-1
Remove substitution for not defined variables
This commit is contained in:
@@ -76,6 +76,8 @@ class LineFormatter extends NormalizerFormatter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$output = preg_replace('/%extra\..+?%/', '', $output);
|
||||||
|
|
||||||
foreach ($vars['context'] as $var => $val) {
|
foreach ($vars['context'] as $var => $val) {
|
||||||
if (false !== strpos($output, '%context.'.$var.'%')) {
|
if (false !== strpos($output, '%context.'.$var.'%')) {
|
||||||
$output = str_replace('%context.'.$var.'%', $this->stringify($val), $output);
|
$output = str_replace('%context.'.$var.'%', $this->stringify($val), $output);
|
||||||
@@ -83,6 +85,8 @@ class LineFormatter extends NormalizerFormatter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$output = preg_replace('/%context\..+?%/', '', $output);
|
||||||
|
|
||||||
if ($this->ignoreEmptyContextAndExtra) {
|
if ($this->ignoreEmptyContextAndExtra) {
|
||||||
if (empty($vars['context'])) {
|
if (empty($vars['context'])) {
|
||||||
unset($vars['context']);
|
unset($vars['context']);
|
||||||
|
Reference in New Issue
Block a user