ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilLogComponentLevel.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
12{
13 private $compontent_id = '';
14 private $component_level = null;
15
16 public function __construct($a_component_id, $a_level = null)
17 {
18 $this->compontent_id = $a_component_id;
19 if ($a_level === null) {
20 $this->read();
21 } else {
22 $this->setLevel($a_level);
23 }
24 }
25
26 public function getComponentId()
27 {
29 }
30
31 public function setLevel($a_level)
32 {
33 $this->component_level = $a_level;
34 }
35
36 public function getLevel()
37 {
39 }
40
41 public function update()
42 {
43 global $ilDB;
44
45 ilLoggerFactory::getLogger('log')->debug('update called');
46
47 $ilDB->replace(
48 'log_components',
49 array('component_id' => array('text',$this->getComponentId())),
50 array('log_level' => array('integer',$this->getLevel()))
51 );
52 }
53
58 public function read()
59 {
60 global $ilDB;
61
62 $query = 'SELECT * FROM log_components ' .
63 'WHERE component_id = ' . $ilDB->quote($this->getComponentId(), 'text');
64
65 $res = $ilDB->query($query);
66 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
67 $this->component_level = $row->log_level;
68 }
69 }
70}
An exception for terminatinating execution or to throw for unit testing.
individual log levels for components
read()
Read entry @global type $ilDB.
__construct($a_component_id, $a_level=null)
static getLogger($a_component_id)
Get component logger.
$query
foreach($_POST as $key=> $value) $res
global $ilDB