ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
class.ilLoggingDBSettings.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
24
35{
36 protected static ?ilLoggingDBSettings $instance = null;
37
38 protected BasicConfig $basic_config;
39 protected ComponentConfig $component_config;
40
41 private function __construct()
42 {
43 $initiator = LegacyInitiator::getInstance();
44 $this->basic_config = $initiator->basicConfig();
45 $this->component_config = $initiator->componentConfig();
46 }
47
48 public static function getInstance(): self
49 {
50 if (self::$instance) {
51 return self::$instance;
52 }
53 return self::$instance = new self();
54 }
55
60 public function getLevelByComponent(string $a_component_id): int
61 {
62 return $this->component_config->level($a_component_id)->value;
63 }
64
68 public function isEnabled(): bool
69 {
70 return $this->basic_config->isLoggingEnabled();
71 }
72
73 public function getLogDir(): string
74 {
75 return $this->basic_config->pathToLogDirectory();
76 }
77
78 public function getLevel(): int
79 {
80 return $this->basic_config->defaultLevel()->value;
81 }
82}
getLevelByComponent(string $a_component_id)
Get level by component.
isEnabled()
Check if logging is enabled.
static ilLoggingDBSettings $instance
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...