Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Change placeholder delimiters

  • Loading branch information...
commit 504b915845b0fe47819fcbabbfbea18e95f5cf5c 1 parent 6a97a6a
@Seldaek Seldaek authored
Showing with 11 additions and 11 deletions.
  1. +1 −1  Psr/Log/LoggerInterface.php
  2. +10 −10 Psr/Log/LoggerInterfaceTest.php
View
2  Psr/Log/LoggerInterface.php
@@ -7,7 +7,7 @@
*
* The message MUST be a string or object implementing __toString().
*
- * The message MAY contain placeholders in the form: %foo% where foo
+ * The message MAY contain placeholders in the form: {foo} where foo
* will be replaced by the context data in key "foo".
*
* The context array can contain arbitrary data, the only assumption that
View
20 Psr/Log/LoggerInterfaceTest.php
@@ -47,14 +47,14 @@ public function testLogsAtAllLevels($level, $message)
public function provideLevelsAndMessages()
{
return array(
- Level::EMERGENCY => array(Level::EMERGENCY, 'message of level emergency with context: %user%'),
- Level::ALERT => array(Level::ALERT, 'message of level alert with context: %user%'),
- Level::CRITICAL => array(Level::CRITICAL, 'message of level critical with context: %user%'),
- Level::ERROR => array(Level::ERROR, 'message of level error with context: %user%'),
- Level::WARNING => array(Level::WARNING, 'message of level warning with context: %user%'),
- Level::NOTICE => array(Level::NOTICE, 'message of level notice with context: %user%'),
- Level::INFO => array(Level::INFO, 'message of level info with context: %user%'),
- Level::DEBUG => array(Level::DEBUG, 'message of level debug with context: %user%'),
+ Level::EMERGENCY => array(Level::EMERGENCY, 'message of level emergency with context: {user}'),
+ Level::ALERT => array(Level::ALERT, 'message of level alert with context: {user}'),
+ Level::CRITICAL => array(Level::CRITICAL, 'message of level critical with context: {user}'),
+ Level::ERROR => array(Level::ERROR, 'message of level error with context: {user}'),
+ Level::WARNING => array(Level::WARNING, 'message of level warning with context: {user}'),
+ Level::NOTICE => array(Level::NOTICE, 'message of level notice with context: {user}'),
+ Level::INFO => array(Level::INFO, 'message of level info with context: {user}'),
+ Level::DEBUG => array(Level::DEBUG, 'message of level debug with context: {user}'),
);
}
@@ -70,9 +70,9 @@ public function testThrowsOnInvalidLevel()
public function testContextReplacement()
{
$logger = $this->getLogger();
- $logger->info('Message %nothing% %user% %foo.bar% 100%', array('user' => 'Bob', 'foo.bar' => 'Bar'));
+ $logger->info('{Message {nothing} {user} {foo.bar} a}', array('user' => 'Bob', 'foo.bar' => 'Bar'));
- $expected = array('info Message %nothing% Bob Bar 100%');
+ $expected = array('info {Message {nothing} Bob Bar a}');
$this->assertEquals($expected, $this->getLogs());
}
Please sign in to comment.
Something went wrong with that request. Please try again.