Skip to content

Commit

Permalink
json_encode JSON_UNESCAPED_UNICODE
Browse files Browse the repository at this point in the history
  • Loading branch information
GaziYucel committed Apr 30, 2024
1 parent f3b386e commit afc4fef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions classes/Helpers/LogHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private static function processMessage(mixed $message, string $level): string

// convert message to string
if (is_object($message) || is_array($message)) {
$message = json_encode($message, JSON_UNESCAPED_SLASHES);
$message = json_encode($message, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
if (json_last_error() !== JSON_ERROR_NONE) $message = var_export($message, true);
}

Expand All @@ -94,7 +94,7 @@ private static function processMessage(mixed $message, string $level): string
$backTrace[2]['class'] . '\\' . $backTrace[2]['function'] . ': ' . $message . "\n";

// add extra debug information if debug level
if($level === 'DBG') {
if ($level === 'DBG') {
$backTrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
$message .= ' ' . json_encode($backTrace, JSON_UNESCAPED_SLASHES) . "\n";
}
Expand Down

0 comments on commit afc4fef

Please sign in to comment.