[ Index ] |
PHP Cross Reference of YOURLS |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * 4 * This file is part of Aura for PHP. 5 * 6 * @license https://opensource.org/licenses/MIT MIT 7 * 8 */ 9 namespace Aura\Sql\Profiler; 10 11 use Psr\Log\AbstractLogger; 12 13 /** 14 * 15 * A naive memory-based logger. 16 * 17 * @package Aura.Sql 18 * 19 */ 20 class MemoryLogger extends AbstractLogger 21 { 22 /** 23 * 24 * Log messages. 25 * 26 * @var array 27 * 28 */ 29 protected $messages = []; 30 31 /** 32 * 33 * Logs a message. 34 * 35 * @param mixed $level The log level (ignored). 36 * 37 * @param string $message The log message. 38 * 39 * @param array $context Data to interpolate into the message. 40 * 41 * @return null 42 * 43 */ 44 public function log($level, $message, array $context = []) 45 { 46 $replace = []; 47 foreach ($context as $key => $val) { 48 $replace['{' . $key . '}'] = $val; 49 } 50 $this->messages[] = strtr($message, $replace); 51 } 52 53 /** 54 * 55 * Returns the logged messages. 56 * 57 * @return array 58 * 59 */ 60 public function getMessages() 61 { 62 return $this->messages; 63 } 64 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Tue Jan 21 05:10:11 2025 | Cross-referenced by PHPXref 0.7.1 |