Skip to content

Commit

Permalink
Fix 255 exit code from codeception
Browse files Browse the repository at this point in the history
  • Loading branch information
angrybrad committed May 23, 2019
1 parent f76aa49 commit ae576bf
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/base/LogTargetTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,17 @@ protected function getContextMessage(): string
{
$context = ArrayHelper::filter($GLOBALS, $this->logVars);
$result = [];
$security = Craft::$app->getSecurity();

foreach ($context as $key => $value) {
$value = $security->redactIfSensitive($key, $value);
$result[] = "\${$key} = " . VarDumper::dumpAsString($value);
// Workaround for codeception testing until these gets addressed:
// https://github.com/yiisoft/yii-core/issues/49
// https://github.com/yiisoft/yii2/issues/15847
if (Craft::$app) {
$security = Craft::$app->getSecurity();

foreach ($context as $key => $value) {
$value = $security->redactIfSensitive($key, $value);
$result[] = "\${$key} = " . VarDumper::dumpAsString($value);
}
}

return implode("\n\n", $result);
Expand Down

0 comments on commit ae576bf

Please sign in to comment.