[ Index ] |
PHP Cross Reference of phpBB-3.2.11-deutsch |
[Summary view] [Print] [Text view]
1 <?php 2 3 /* 4 * @package s9e\TextFormatter 5 * @copyright Copyright (c) 2010-2019 The s9e Authors 6 * @license http://www.opensource.org/licenses/mit-license.php The MIT License 7 */ 8 namespace s9e\TextFormatter\Parser; 9 use InvalidArgumentException; 10 use s9e\TextFormatter\Parser; 11 class Logger 12 { 13 protected $attrName; 14 protected $logs = []; 15 protected $tag; 16 protected function add($type, $msg, array $context) 17 { 18 if (!isset($context['attrName']) && isset($this->attrName)) 19 $context['attrName'] = $this->attrName; 20 if (!isset($context['tag']) && isset($this->tag)) 21 $context['tag'] = $this->tag; 22 $this->logs[] = [$type, $msg, $context]; 23 } 24 public function clear() 25 { 26 $this->logs = []; 27 $this->unsetAttribute(); 28 $this->unsetTag(); 29 } 30 public function getLogs() 31 { 32 return $this->logs; 33 } 34 public function setAttribute($attrName) 35 { 36 $this->attrName = $attrName; 37 } 38 public function setTag(Tag $tag) 39 { 40 $this->tag = $tag; 41 } 42 public function unsetAttribute() 43 { 44 unset($this->attrName); 45 } 46 public function unsetTag() 47 { 48 unset($this->tag); 49 } 50 public function debug($msg, array $context = []) 51 { 52 $this->add('debug', $msg, $context); 53 } 54 public function err($msg, array $context = []) 55 { 56 $this->add('err', $msg, $context); 57 } 58 public function info($msg, array $context = []) 59 { 60 $this->add('info', $msg, $context); 61 } 62 public function warn($msg, array $context = []) 63 { 64 $this->add('warn', $msg, $context); 65 } 66 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Wed Nov 11 20:33:01 2020 | Cross-referenced by PHPXref 0.7.1 |