diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2014-05-12 10:54:09 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2014-05-12 10:54:09 +0200 |
commit | d853c60d7e4eba63c8cb402249b7b77b94c4c764 (patch) | |
tree | 89161a440614eb9ee74b2968b953aa30699e0df4 /lib/private/log.php | |
parent | b4298c68ca3b79abb7413452311daf074206c31c (diff) | |
download | nextcloud-server-d853c60d7e4eba63c8cb402249b7b77b94c4c764.tar.gz nextcloud-server-d853c60d7e4eba63c8cb402249b7b77b94c4c764.zip |
adding interpolation as requested by PSR-3
Diffstat (limited to 'lib/private/log.php')
-rw-r--r-- | lib/private/log.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/private/log.php b/lib/private/log.php index c7a3b99a5e0..682f6321474 100644 --- a/lib/private/log.php +++ b/lib/private/log.php @@ -144,6 +144,15 @@ class Log implements ILogger { } else { $app = 'no app in context'; } + // interpolate $message as defined in PSR-3 + $replace = array(); + foreach ($context as $key => $val) { + $replace['{' . $key . '}'] = $val; + } + + // interpolate replacement values into the message and return + $message = strtr($message, $replace); + $logger=$this->logger; $logger::write($app, $message, $level); } |