Report log

@param string $subject
@param string $message
@param string $destination
@param string $time

@return bool
763378
public static function report(String $subject, String $message, String $destination = NULL, String $time = NULL) : Bool
    {
        return Helper::report($subject, $message, $destination, $time);
    }
1140110
private function getMessage(string $subject, string $message): \Swift_Message
    {
        $messageObject = new \Swift_Message($subject, $message);
        $messageObject
            ->setFrom([$this->config('mailer.sender_email') => $this->config('mailer.sender_name')])
            ->setTo($this->config('mailer.recipients'))
        ;

        return $messageObject;
    }
372430
public static function alert(String $message, String $time = NULL)
	{
		return self::report(__FUNCTION__, $message, NULL, $time);
	}
1227826
public function log($level, $message, array $context = array())
    {
        if($context != []){
            /** @var DumpFile $dumpFile */
            $dumpFile = true;

            $t = $this->logFile->log($message, $level, $dumpFile);
            $dumpFile->writeSerialized($context);
        } else {
            $t = $this->logFile->log($message, $level);
        }

        return $t;

    }
54599
public function log($level, $message, array $context = []) {
		if (!Logger::check($level)) {
			return;
		}
		if (count($context) > 0) {
			foreach ($context as $k => $v) {
				$message = str_replace('{' . $k . '}', $v, $message);
			}
		}
		$content = sprintf("%s | %s | %s | %s", date('Y-m-d H:i:s'), $this->getLevel($level), microtime(true), $message);
		co::fwrite($this->handler, $content);
	}
22644
public function log($level, $message, array $context = array())
    {
        if (!$this->shouldHandle($level)) {
            return false;
        }

        $levelName = is_int($level) ? array_search($level, self::$levels) : $level;
        $message = $this->interpolate(
            array(
                'message' => $message,
                'context' => $context,
                'level' => strtoupper($levelName),
                'datetime' => new \DateTime(),
            )
        );

        $this->write($message);
    }
614788
private function logMessage(Message $message)
    {
        $logMessage = \sprintf(
            '%s %s (%.3Fs)',
            $message->getRequest()->getMethod(),
            (string) $message->getRequest()->getUri(),
            $message->getDuration()
        );

        // This is a "simple" log, for general purpose
        $this->logger->log(
            $message->getLogLevel(),
            $logMessage
        );

        // This is a debug log, with all message details, useful for debugging
        $this->logger->debug($logMessage, $message->jsonSerialize());
    }
845255
public static function notice(String $message, String $time = NULL)
	{
		return self::report(__FUNCTION__, $message, NULL, $time);
	}
409407
public void doLog(String clientID, String name, long time, Level level,
			Object message, Throwable t) {
		if (logOpen && formatter != null) {
			sendMessage(syslogMessage.createMessageData(formatter.format(clientID, name, time, level, message, t)));
		}
	}
1069125
public function log($level, $message, array $context = [])
    {
        // `Vips\Image` to string convert
        array_walk_recursive($context, function (&$value) {
            if ($value instanceof Image) {
                $value = (string) $value;
            }
        });

        $strParams = [
            '%datetime%' => date(DATE_FORMAT),
            '%level_name%' => $level,
            '%message%' => $message,
            '%context%' => json_encode(
                $context,
                JSON_UNESCAPED_SLASHES |
                JSON_UNESCAPED_UNICODE |
                JSON_PRESERVE_ZERO_FRACTION
            ),
        ];

        echo strtr(LOG_FORMAT, $strParams);
    }
685661
public function postMessage($sender, $recipient, $message)
    {
        if ($this->maxMessages) {
            $statement = $this->connection->prepare(
                'SELECT COUNT(*) FROM "phergie-plugin-tell"
                    WHERE "recipient" = ?;'
            );
            $statement->execute([ $recipient ]);

            if ($statement->fetchColumn(0) >= $this->maxMessages) {
                return false;
            }
        }

        $this->connection->prepare(
            'INSERT INTO "phergie-plugin-tell"
                ("sender", "recipient", "message")
                VALUES (?, ?, ?);'
        )->execute([ $sender, $recipient, $message ]);

        return true;
    }
692662
public function sendMessage($recipients, $sender, $subject, $content)
    {
        $this->client->sendMessage($this->createMessage($recipients, $sender, $subject, $content));
    }
1046274
public function send(string $address, string $subject, ?string $message = null): bool
    {
        // try to get message from global if not passed direct
        if ($message === null) {
            $message = $this->message;
        }

        try {
            if ($message === null) {
                throw new \Exception('Message body is empty!');
            }

            // try to build message and send it
            $message = (new \Swift_Message($subject))
                ->setFrom($this->from)
                ->setTo($address)
                ->setBody($message, 'text/html');
            $this->swift->send($message);
            return true;
        } catch (\Exception $e) {
            if (App::$Debug) {
                App::$Debug->addException($e);
                App::$Debug->addMessage('Send mail failed! Info: ' . $e->getMessage(), 'error');
            }
            return false;
        }
    }
1131682
public static function emergency(String $message, String $time = NULL)
	{
		return self::report(__FUNCTION__, $message, NULL, $time);
	}
188695
public function log($level, $message, array $context = [])
    {
        $exception = isset($context['exception']) ? $context['exception'] : null;
        $microTime = microtime(true);
        $micro = sprintf("%06d", ($microTime - floor($microTime)) * 1000000);
        $logTime = (new \DateTime(date('Y-m-d H:i:s.' . $micro, $microTime)))->format('Y-m-d H:i:s.u');
        error_log(
            '[' . $logTime . '] '
            .$message.($exception ? ' {Exception: '.$exception->getMessage().'}' : '')."\n",
            3,
            $this->file,
            null
        );
    }
578788
public function log($message = '', $context = [], $level = Logger::NOTICE, $role = 'system', $times = 0, $ttl = 0)
    {
        if ($this->isSingle()) {
            LogComponent::component()->record($message, $context, $level, $role, $times, $ttl);
        }
    }
689858
public function log($level, $message, array $context = array())
    {
        if ($this->filtering && ! in_array($level, $this->enabled)) {
            return;
        }

        if ($this->apply_threshold) {
            return $this->writeThresholdedMessage($level, $message);
        }

        $this->writeMessage($level, $message);
    }