Write or print a log

@param mixed $data Data to log
@param string $level Event type
@param mixed $type Additional identifier
@return mixed|void
548035
public function log($data, $level = self::LEVEL_INFO, $type = null)
    {
        if (!is_string($data)) {
            $data = print_r($data, true);
        }

        file_put_contents(
            $this->getLogDirectory() . '/' . $this->getLogFilename(),
            $this->getLogMessage($data, $level, $type),
            FILE_APPEND
        );
    }
35856
public function log($level, $message, array $context = []): void {
        if ($this->logger instanceof LoggerInterface) {
            $message = $this->interpolate($message, $context);
            $this->logger->log($level, $message, $context);
        }
    }
923944
public function write($object, $level)
    {
        //Determine label
        $label = 'DEBUG';
        switch ($level) {
            case \Yee\Log::FATAL:
                $label = 'FATAL';
                break;
            case \Yee\Log::ERROR:
                $label = 'ERROR';
                break;
            case \Yee\Log::WARN:
                $label = 'WARN';
                break;
            case \Yee\Log::INFO:
                $label = 'INFO';
                break;
        }

        //Get formatted log message
        $message = str_replace(array(
            '%label%',
            '%date%',
            '%message%'
        ), array(
            $label,
            date('Y-m-d H:i:s'),
            (string)$object
        ), $this->settings['message_format']);

        //Open resource handle to log file
        if (!$this->resource) {
            $filename = date($this->settings['name_format']);
            if (! empty($this->settings['extension'])) {
                $filename .= '.' . $this->settings['extension'];
            }
            $this->resource = fopen($this->settings['path'] . DIRECTORY_SEPARATOR . $filename, 'a');
        }

       
        
        //Output to resource
        fwrite($this->resource, $message . PHP_EOL);
    }
1283140
public function write($message, $level = null)
    {
        if ($this->isSilent()) {
            return;
        }

        if ($level && ($this->verbosity < $level)) {
            return;
        }

        $message = $this->filter->filter($message);
        $this->adapter->write($message);
    }
938589
public function log($msg, $level = Project::MSG_INFO)
    {
        $this->logObject($this, $msg, $level);
    }
398845
public function log($type = null, $data = [])
    {
        if (!func_num_args()) {
            return $this->_log;
        }
        $this->report($type, $this->log()->add($type, $data));
    }
1344631
public function log($level, $message, array $context = array()) {
		$message = preg_replace("/[\r\n]+/", $this->replacement, $message);
		$this->logger()->log($level, $message, $context);
	}
1236928
public static void log(final Level level, final String message) {
		System.err.println("LOGGER " + level + ": " + message);
	}
389432
protected function write($level, $msg)
    {
        $time = date('Y-m-d H:i:s', time());
        $msg = "[" . $time . "][" . static::getLevelName($level) . "] " . $msg . PHP_EOL;

        if($this->debugOutput === true){
            echo $msg;
        }
        if (static::$silent) {
            return false;
        }
        if (!$this->isAllowed($level)) {
            return false;
        }
        $fh = fopen($this->logFile, 'a');
        if (!fwrite($fh, $msg)) {
            throw new \Exception('Failed to write to log file at ' . $this->logFile);
        }

        return true;
    }
901740
function Log($level,$message, $data = "")
	{
		$data = $data != "" ? ": $data" : "";
		switch ($level)
		{
			case DBH_LOG_DEBUG:
				if ($this->LogLevel & DBH_LOG_DEBUG) print "<pre style='color: silver;'>$message</pre>\r\n";
				break;
			case DBH_LOG_INFO:
				if ($this->LogLevel & DBH_LOG_INFO) print "<pre style='color: blue;'>$message $data</pre>\r\n";
				break;
			case DBH_LOG_QUERY:
				if ($this->LogLevel & DBH_LOG_QUERY) print "<pre style='color: green;'>$message $data</pre>\r\n";
				break;
			case DBH_LOG_WARNING:
				if ($this->LogLevel & DBH_LOG_WARNING) print "<pre style='color: orange;'>$message $data</pre>\r\n";
				break;
			case DBH_LOG_ERROR:
				if ($this->LogLevel & DBH_LOG_ERROR) print "<pre style='color: red;'>$message $data</pre>\r\n";
				break;
		}
		
	}
1325047
public void log(String message, Level level) {
    log(null, null, message, level);
  }
353580
public function log($level, $message, array $context = array())
    {
        if (!array_key_exists($level, $this->levels)) {
            $level = $this->defaultLevel;
        }
        
        $level = \LoggerLevel::toLevel($this->levels[$level], $this->defaultLevel);
        
        $message = $this->formatter->format($level, $message, $context);

        $this->logger->log($level, $message);
    }
1252219
public function log($msg, $level = Project::MSG_INFO, Exception $t = null)
    {
        if ($this->getProject() !== null) {
            $this->getProject()->logObject($this, $msg, $level, $t);
        } else {
            parent::log($msg, $level);
        }
    }
1170610
public function log($level, $message, array $context = [])
    {
        $message = $this->_format($message, $context);
        $output = date('Y-m-d H:i:s') . ' ' . ucfirst($level) . ': ' . $message;

        return (bool)$this->_output->write(sprintf('<%s>%s</%s>', $level, $output, $level));
    }
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);
	}
1298353
protected function _logError($level, $data)
    {
        $message = sprintf(
            '%s (%s): %s in [%s, line %s]',
            $data['error'],
            $data['code'],
            $data['description'],
            $data['file'],
            $data['line']
        );
        if (!empty($this->_options['trace'])) {
            $trace = Debugger::trace([
                'start' => 1,
                'format' => 'log'
            ]);

            $request = Router::getRequest();
            if ($request) {
                $message .= $this->_requestContext($request);
            }
            $message .= "\nTrace:\n" . $trace . "\n";
        }
        $message .= "\n\n";

        return Log::write($level, $message);
    }
663480
public void write(String logService, LogLevel level, String msg)
	{
		doWrite(logService, level, msg, null);
	}