Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
12345 anikendra 1
<?php
2
/**
3
 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
4
 * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
5
 *
6
 * Licensed under The MIT License
7
 * Redistributions of files must retain the above copyright notice.
8
 *
9
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
10
 * @link          http://cakephp.org CakePHP(tm) Project
11
 * @license       http://www.opensource.org/licenses/mit-license.php MIT License
12
 */
13
 
14
/**
15
 * A CakeLog listener which saves having to munge files or other configured loggers.
16
 *
17
 */
18
class DebugKitLog implements CakeLogInterface {
19
 
20
/**
21
 * logs
22
 *
23
 * @var array
24
 */
25
	public $logs = array();
26
 
27
/**
28
 * Makes the reverse link needed to get the logs later.
29
 *
30
 * @param $options
31
 * @return \DebugKitLog
32
 */
33
	public function __construct($options) {
34
		$options['panel']->logger = $this;
35
	}
36
 
37
/**
38
 * Captures log messages in memory
39
 *
40
 * @param $type
41
 * @param $message
42
 * @return void
43
 */
44
	public function write($type, $message) {
45
		if (!isset($this->logs[$type])) {
46
			$this->logs[$type] = array();
47
		}
48
		$this->logs[$type][] = array(date('Y-m-d H:i:s'), (string)$message);
49
	}
50
}