ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 $DIC;
44
45 $ilDB = $DIC['ilDB'];
46
47 ilLoggerFactory::getLogger('log')->debug('update called');
48
49 $ilDB->replace(
50 'log_components',
51 array('component_id' => array('text',$this->getComponentId())),
52 array('log_level' => array('integer',$this->getLevel()))
53 );
54 }
55
60 public function read()
61 {
62 global $DIC;
63
64 $ilDB = $DIC['ilDB'];
65
66 $query = 'SELECT * FROM log_components ' .
67 'WHERE component_id = ' . $ilDB->quote($this->getComponentId(), 'text');
68
69 $res = $ilDB->query($query);
70 while ($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT)) {
71 $this->component_level = $row->log_level;
72 }
73 }
74}
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.
$row
$query
global $DIC
Definition: saml.php:7
foreach($_POST as $key=> $value) $res
global $ilDB