ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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)
17 {
18 $this->compontent_id = $a_component_id;
19 $this->read();
20 }
21
22 public function getComponentId()
23 {
25 }
26
27 public function setLevel($a_level)
28 {
29 $this->component_level = $a_level;
30 }
31
32 public function getLevel()
33 {
35 }
36
37 public function update()
38 {
39 global $ilDB;
40
41 ilLoggerFactory::getLogger('log')->debug('update called');
42
43 $ilDB->replace(
44 'log_components',
45 array('component_id' => array('text',$this->getComponentId())),
46 array('log_level' => array('integer',$this->getLevel()))
47 );
48 }
49
54 public function read()
55 {
56 global $ilDB;
57
58 $query = 'SELECT * FROM log_components '.
59 'WHERE component_id = '.$ilDB->quote($this->getComponentId(),'text');
60
61 $res = $ilDB->query($query);
62 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
63 {
64 $this->component_level = $row->log_level;
65 }
66
67 }
68}
69?>
An exception for terminatinating execution or to throw for unit testing.
individual log levels for components
read()
Read entry @global type $ilDB.
static getLogger($a_component_id)
Get component logger.
global $ilDB