ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
IRSSEventLogObserver.php
Go to the documentation of this file.
1<?php
2
19namespace ILIAS\ResourceStorage;
20
24
29{
30 public function __construct(private \ilLogger $logger)
31 {
32 }
33
34 public function getId(): string
35 {
36 return self::class;
37 }
38
39 private function appendData(string $to_message, ?Data $data = null): string
40 {
41 return $to_message . ': ' . ($data ? json_encode($data->getArrayCopy()) : '');
42 }
43
44
45 public function update(Event $event, ?Data $data): void
46 {
47 match ($event->value) {
48 Event::COLLECTION_RESOURCE_ADDED => $this->logger->info($this->appendData("Collection resource added", $data)),
49 Event::FLAVOUR_BUILD_SUCCESS => $this->logger->info($this->appendData("Flavour build success", $data)),
50 Event::FLAVOUR_BUILD_FAILED => $this->logger->warning($this->appendData("Flavour build failed", $data)),
51 default => $this->logger->debug($this->appendData($event->value, $data))
52 };
53 }
54
55 public function updateFailed(\Throwable $e, Event $event, ?Data $data): void
56 {
57 // nothing to do
58 }
59
60}
appendData(string $to_message, ?Data $data=null)
updateFailed(\Throwable $e, Event $event, ?Data $data)
getId()
Unique identifier of the implementing event-listener.
Component logger with individual log levels by component id.
@ FLAVOUR_BUILD_FAILED
event string being used if a new Resource has been stored to the IRSS.
Definition: Event.php:52
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...