19 declare(strict_types=1);
39 private readonly
Factory $interaction_factory,
47 return $this->logging_settings->isLoggingEnabled();
52 return $this->logging_settings->isIPLoggingEnabled();
57 return $this->logging_repository->testHasParticipantInteractions($ref_id);
62 $this->logging_repository->deleteParticipantInteractionsForTest($ref_id);
67 $this->logging_repository->storeTestAdministrationInteraction($interaction);
72 $this->logging_repository->storeQuestionAdministrationInteraction($interaction);
77 $this->logging_repository->storeParticipantInteraction($interaction);
82 $this->logging_repository->storeScoringInteraction($interaction);
87 $this->component_logger->emergency($message,
$context);
89 if (!$this->logging_settings->isLoggingEnabled()
94 $this->logging_repository->storeError(
100 $this->component_logger->alert($message,
$context);
102 if (!$this->logging_settings->isLoggingEnabled()
107 $this->logging_repository->storeError(
114 $this->component_logger->critical($message,
$context);
116 if (!$this->logging_settings->isLoggingEnabled()
121 $this->logging_repository->storeError(
128 if (!$this->logging_settings->isLoggingEnabled()
133 $this->logging_repository->storeError(
136 $this->component_logger->error($message,
$context);
141 $this->component_logger->warning($message,
$context);
146 $this->component_logger->notice($message,
$context);
151 $this->component_logger->info($message,
$context);
156 $this->component_logger->debug($message,
$context);
161 $this->component_logger->log($message, $level,
$context);
163 if (!$this->logging_settings->isLoggingEnabled()
169 $this->logging_repository->storeError(
176 return $this->component_logger;
181 return $this->interaction_factory;
186 return $this->additional_information;
194 return array_keys(self::LOG_ENTRY_TYPES);
199 $interaction_types = [];
200 foreach (self::LOG_ENTRY_TYPES as $type => $enum_class) {
201 $interaction_types[$type] = array_column($enum_class::cases(),
'value');
203 return $interaction_types;
210 $context [
'question_id'] ??
null,
211 $context[
'administrator'] ?? null,
212 $context[
'participant'] ?? null,
214 $context[
'timestamp'] ?? time(),
notice(string|\Stringable $message, array $context=[])
info(string|\Stringable $message, array $context=[])
critical(string|\Stringable $message, array $context=[])
testHasParticipantInteractions(int $ref_id)
alert(string|\Stringable $message, array $context=[])
Component logger with individual log levels by component id.
logScoringInteraction(TestScoringInteraction $interaction)
logQuestionAdministrationInteraction(TestQuestionAdministrationInteraction $interaction)
createTestErrorFromContext(array $context, string $message)
getAdditionalInformationGenerator()
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
log($level, string|\Stringable $message, mixed $context=[])
warning(string|\Stringable $message, array $context=[])
emergency(string|\Stringable $message, array $context=[])
debug(string|\Stringable $message, array $context=[])
logTestAdministrationInteraction(TestAdministrationInteraction $interaction)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
deleteParticipantInteractionsForTest(int $ref_id)
__construct(private readonly TestLoggingSettings $logging_settings, private readonly TestLoggingRepository $logging_repository, private readonly Factory $interaction_factory, private readonly AdditionalInformationGenerator $additional_information, private readonly \ilComponentLogger $component_logger,)
error(string|\Stringable $message, array $context=[])
logParticipantInteraction(TestParticipantInteraction $interaction)