Fired whenever a message is logged.

@param BuildEvent $event The BuildEvent
@see   BuildEvent::getMessage()
177899
public function messageLogged(BuildEvent $event)
    {
        $priority = $event->getPriority();
        if ($priority <= $this->msgOutputLevel) {
            $this->bar->setMessage(str_replace(["\n", "\r"], ["", ""], $event->getMessage()));
            $this->bar->display();
        }
    }
984643
private function formatEventMessage(Event $event)
    {
        $message = null;
        $entityName = null;
        
        if ($event instanceof OrmEventInterface) {
            switch (true) {
                case ($event instanceof EntityLifecycleEvent):
                    $entityName = $event->getRepository()->getEntityName();
                    $message = $this->entityToString($event->getEntity());
                    break;
                case ($event instanceof MetadataLoadEvent):
                    $message = $this->metadataToString($event->getMetadata());
                    $entityName = $event->getMetadata()->getEntityClass();
                    break;
                case ($event instanceof FinderExecutionEvent):
                    $entityName = $event->getRepository()->getEntityName();
                    $query = $event->getSelectQuery();
                    $message = sprintf("SQL: (%s)", str_replace("\n", "\x20", $query->toSQL()));
                    break;
            }
        }
        
        $eventName = sprintf('%s::%s', (new \ReflectionObject($event))->getShortName(), $event->getName());
        $separator = str_repeat('-', 32);
        
        return sprintf("%s\n[%s]\nEntityClassName: %s\n%s", $separator, $eventName, $entityName, $message);
    }
513462
protected function dispatchSentEvent($message, $data = [])
    {
        if ($this->events) {
            $this->events->dispatch(
                new Events\MessageSent($message->getSwiftMessage(), $data)
            );
        }
    }
820951
private function logEvent($event, $message, $level)
    {
        if ($event === 'not-allowed') {
            $message = sprintf('Method Not Allowed: %s', $message);
        } elseif ($event === 'not-found') {
            $message = sprintf('Page Not Found: %s', $message);
        }

        $this->logger->$level($message);
    }
12282
private function message($msg, $level)
    {
        if ($this->transcoder) {
            $this->transcoder->dispatch(TranscodeEvents::MESSAGE, new MessageEvent($msg, $level, $this));
        }
    }
412138
public function sendEvent(Event $event)
    {
        try {
            $this->eventFactory->addDefaultTagsToEntity($event);
            $this->sendEventThroughSenders($event);
        } catch (\Exception $exception) {
            $this->logException($exception);
        }
    }
1309184
public function onLog(LogGenericEvent $event)
    {
        if ($event instanceof NotifiableInterface && $this->ch->getParameter('is_notification_active')) {
            $workspace = $event->getWorkspace();
            if ($event->isAllowedToNotify() &&
                (null === $workspace || (null !== $workspace && !$workspace->isDisabledNotifications()))
            ) {
                $this->notificationManager->createNotificationAndNotify($event);
            }
        }
    }
593789
@Override
    public void messageLogged(final BuildEvent event) {
        final int priority = event.getPriority();
        // Filter out messages based on priority
        if (priority <= msgOutputLevel) {

            final StringBuilder message = new StringBuilder();
            if (event.getTask() != null && !emacsMode) {
                // Print out the name of the task if we're in one
                final String name = event.getTask().getTaskName();
                String label = "[" + name + "] ";
                final int size = LEFT_COLUMN_SIZE - label.length();
                final StringBuilder tmp = new StringBuilder();
                for (int i = 0; i < size; i++) {
                    tmp.append(" ");
                }
                tmp.append(label);
                label = tmp.toString();

                BufferedReader r = null;
                try {
                    r = new BufferedReader(new StringReader(event.getMessage()));
                    String line = r.readLine();
                    boolean first = true;
                    do {
                        if (first) {
                            if (line == null) {
                                message.append(label);
                                break;
                            }
                        } else {
                            message.append(StringUtils.LINE_SEP);
                        }
                        first = false;
                        message.append(label).append(line);
                        line = r.readLine();
                    } while (line != null);
                } catch (final IOException e) {
                    // shouldn't be possible
                    message.append(label).append(event.getMessage());
                } finally {
                    if (r != null) {
                        FileUtils.close(r);
                    }
                }

            } else {
                // emacs mode or there is no task
                message.append(event.getMessage());
            }
            final Throwable ex = event.getException();
            if (Project.MSG_DEBUG <= msgOutputLevel && ex != null) {
                message.append(StringUtils.getStackTrace(ex));
            }

            final String msg = message.toString();
            if (priority != Project.MSG_ERR) {
                printMessage(msg, out, priority);
            } else {
                printMessage(msg, err, priority);
            }
            log(msg);
        }
    }
783435
public function onReportBuilder(ReportBuilderEvent $event)
    {
        if (!$event->checkContext([self::CONTEXT_CONTACT_LEDGER_CLIENT_STATS, self::CONTEXT_CONTACT_LEDGER_SOURCE_STATS])) {
            return;
        }

        if ($event->checkContext(self::CONTEXT_CONTACT_LEDGER_CLIENT_STATS)) {
            $this->onClientReportBuilder($event);
        }

        if ($event->checkContext(self::CONTEXT_CONTACT_LEDGER_SOURCE_STATS)) {
            $this->onSourceReportBuilder($event);
        }
    }
1123669
public function emit($event)
    {
        $emitter = $this->getEmitter();
        $arguments = [$event] + func_get_args();

        return call_user_func_array([$emitter, 'emit'], $arguments);
    }
605480
public void messageLogged(final BuildEvent event) {
        int priority = event.getPriority();
        // Filter out messages based on priority
        if (priority <= msgOutputLevel) {

            final String msg = expandMessage(event, event.getMessage());

            if (priority != Project.MSG_ERR) {
                printMessage(msg, out, priority);
            } else {
                printMessage(msg, err, priority);
            }
            log(msg);
        }
    }
1104629
private static function onReceivedMessage(string $event, $data)
    {
        foreach (self::$onMessage[$event] ?? [] as $callback) {
            asyncCall($callback, $data);
        }
    }
805190
public function buildStarted(BuildEvent $event)
    {
        $this->buildTimerStart = Phing::currentTimeMillis();
        $this->buildElement = $this->doc->createElement(XmlLogger::BUILD_TAG);
        $this->elementStack[] = $this->buildElement;
        $this->timesStack[] = $this->buildTimerStart;
    }
501165
private void onMessageSent(MessageSentEvent event) {
        handler.post(() -> listener.onMessageSent(event));
        log("Event published " + event.toString());
    }
84044
public function setMessage($message = '')
    {
        if (!is_string($message)) {
            throw new BuildException(
                '"message" attribute is invalid.' .
                ' Expect to be a string, actual is ' . gettype($message)
            );
        }

        $this->message = $message;
    }
1200545
public function recordThat(Message $event): void
    {
        if (! \array_key_exists($event->messageName(), $this->eventApplyMap)) {
            throw new \RuntimeException('Wrong event recording detected. Unknown event passed to GenericAggregateRoot: ' . $event->messageName());
        }

        $this->version += 1;

        $event = $event->withAddedMetadata('_aggregate_id', $this->aggregateId());
        $event = $event->withAddedMetadata('_aggregate_version', $this->version);
        $this->recordedEvents[] = $event;

        $this->apply($event);
    }
745021
public function onLog(LogGenericEvent $event)
    {
        if (!($event instanceof LogNotRepeatableInterface) or !$this->isARepeat($event)) {
            $this->createLog($event);
        }
    }