Traces a categorized data in the error log default system and stores it inside
the instance to be transmited after to a logs analyzer database.
@param string|null $key Categorized data key identifier
@param mixed|null $message Text message to log
186620
public function traceLog(string $key = null, $message = null)
    {
        if ($this->trace_log_enabled) {
            if (is_array($message) || is_object($message)) {
                $text = print_r($message, true);
            } elseif ($message === null) {
                $text = "[null]";
            } elseif ($message === false) {
                $text = "[false]";
            } elseif ($message === true) {
                $text = "[true]";
            } else {
                $text = $message;
            }
            error_log("=== " . ($key !== null ? "$key: " : '') . $text);
        }

        if ($key === null) {
            if ($this->trace_log_buffer === null) {
                $this->trace_log_buffer = array();
            }
            if (array_key_exists(self::MESSAGES_STACK, $this->trace_log_buffer)) {
                $this->trace_log_buffer[self::MESSAGES_STACK][] = $message;
            } else {
                $this->trace_log_buffer[self::MESSAGES_STACK] = array($message);
            }
        } else {
            $this->trace_log_buffer[$key] = $message;
        }
    }
1023233
public static function write($message = null, $padding = null)
    {
        if ($padding > 0) {
            $message = str_pad($message, $padding, ' ');
        }

        self::stdOut($message);
    }
337787
public function debug($message, $data = null)
    {
        if (config('eyewitness.debug', false)) {
            Log::debug('Eyewitness: '.$message, ['data' => $data]);
        }
    }
576255
protected function logError($message)
    {
        if ($this->logger instanceof LoggerInterface) {
            $this->logger->error($message);
        } else {
            error_log($message);
        }
    }
1190332
public static void error(Object message) {
		log(Level.ERROR, message, null, (Object[])null);
	}
1084317
public function log($level, $message, array $context = array())
    {
        $errorLevel = isset(self::$map[$level]) ? self::$map[$level] : common_Logger::ERROR_LEVEL;
        $this->logger->log($errorLevel, $message, $context);
    }
704684
protected function fail($message = null, $key = null)
    {
        $message = $message ?: static::class.' failed.';
        $key = $key ?: static::class;

        throw new PerformerException($message, $key);
    }
443879
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);
			}
		}
		syslog($this->getLevel($level), $message);
	}
863674
public function debug($message, string $category = 'application'): void
    {
        $this->log(LogLevel::DEBUG, $message, $category);
    }
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());
    }
1339605
protected function log($message, $context)
    {
        $logger = $this->getLogger();
        if ($logger !== null) {
            $logger->error($message, $context);
        }
    }
197306
public static function output($message, $data = null)
    {
        if (static::$mode == "html") {
            static::html($message, $data);
        } else {
            static::text($message, $data);
        }
    }
1104036
public function logMessage(Message $message): void
    {
        if (in_array($message->getLevel(), $this->config['log'])) {
            if ($this->config['send_immediately']) {

                call_user_func($this->config['exec'], $message);

            } else {
                $this->messages[] = $message;

                if (count($this->messages) == 1) {
                    // register shutdown on first message in queue
                    $self = $this;
                    register_shutdown_function(function () use ($self) {
                        $fn = $self->getExecFunction();
                        call_user_func($fn, $self->getMessages());
                    });
                }
            }
        }
    }
143644
public function logError($message, $object = null)
    {
        $this->doLog(LogHelper::LOG_LEVEL_ERROR, $message, $object);
    }
1120573
public function trace( string $file, int $line, string $target, string $message, string $tag = NULL )
    {
        self::log( $file, $line, "T:$target", $message, $tag );
    }
1293338
private function tryLogMessage($message)
    {
        $messageId = null;

        if ($message instanceof RemoteMessage) $messageId = $message->header()->uuid();
        elseif ($message instanceof ProcessingMessage) $messageId = $message->uuid();

        if (! $messageId) return;

        $entry = $this->messageLogger->getEntryForMessageId($messageId);

        if ($entry) return;

        $this->messageLogger->logIncomingMessage($message);
    }
132613
public function addMessageNow($key, $message)
    {
        // Create Array for this key
        if (!isset($this->forNow[$key])) {
            $this->forNow[$key] = [];
        }

        // Push onto the array
        $this->forNow[$key][] = $message;
    }