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
App::uses('DebugPanel', 'DebugKit.Lib');
15
 
16
/**
17
 * Log Panel - Reads log entries made this request.
18
 *
19
 */
20
class LogPanel extends DebugPanel {
21
 
22
/**
23
 * Constructor - sets up the log listener.
24
 *
25
 * @return \LogPanel
26
 */
27
	public function __construct() {
28
		parent::__construct();
29
		$existing = CakeLog::configured();
30
		if (empty($existing)) {
31
			CakeLog::config('default', array(
32
				'engine' => 'FileLog'
33
			));
34
		}
35
		CakeLog::config('debug_kit_log_panel', array(
36
			'engine' => 'DebugKit.DebugKitLog',
37
			'panel' => $this
38
		));
39
	}
40
 
41
/**
42
 * beforeRender Callback
43
 *
44
 * @param Controller $controller
45
 * @return array
46
 */
47
	public function beforeRender(Controller $controller) {
48
		$logger = $this->logger;
49
		return $logger;
50
	}
51
}