ILIAS  trunk Revision v11.0_alpha-1843-g9e1fad99175
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
IRSSEventLogObserver.php
Go to the documentation of this file.
1 <?php
2 
19 namespace 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 }
getId()
Unique identifier of the implementing event-listener.
updateFailed(\Throwable $e, Event $event, ?Data $data)
appendData(string $to_message, ?Data $data=null)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
event string being used if a new Resource has been stored to the IRSS.
Definition: Event.php:52