You are here

public static function LoggerTest::debrace in MongoDB 8.2

Replaces PSR-3 braces by angle brackets.

Braces in log($l, $message, $c) will be interpreted as PSR-3 placeholders. As such they need to be avoid when inserted randomly.

Parameters

string $message: The raw message.

Return value

string The replacement message.

See also

\Drupal\Core\Logger\LogMessageParserInterface::parseMessagePlaceholders()

1 call to LoggerTest::debrace()
LoggerTest::testWatchdogLimit in modules/mongodb_watchdog/tests/src/Kernel/LoggerTest.php
Test the default and non-default mongodb_watchdog insertion behaviours.

File

modules/mongodb_watchdog/tests/src/Kernel/LoggerTest.php, line 102

Class

LoggerTest
Class LoggerTest tests the logging mechanism itself.

Namespace

Drupal\Tests\mongodb_watchdog\Kernel

Code

public static function debrace(string $message) : string {
  return str_replace([
    '{',
    '}',
  ], [
    '<',
    '>',
  ], $message);
}