Write message
@param  mixed     $message
@param  int       $level
@return int|bool
518265
public function write($message, $level = null)
    {
        return fwrite($this->resource, (string) $message . PHP_EOL);
    }
958551
public function log($level, $message, array $context = array())
    {
        $log_id = '';
        if ($this->_levels[$this->_level] < $this->_levels[$level]) {
            return false;
        }

        if ($this->_levels[$level] <= $this->_levels[LogLevel::ERROR]) {
            $this->last_log_id = $this->generateId();
            $log_id = "{{$this->last_log_id}} ";
        }

        if (!empty($context)) {
            $message .= PHP_EOL.$this->indent($this->dumpContext($context));
        }

        $message = "[{$this->getTimestamp()}] [".strtoupper($level)."] {$log_id}{$message}".PHP_EOL;

        $this->write($message);

        return true;
    }
805148
public function log($level, $message, array $context = array())
    {
        if ($this->logLevels[$this->logLevelThreshold] < $this->logLevels[$level]) {
            return;
        }
        $message = $this->formatMessage($level, $message, $context);
        $this->write($message);
    }
927209
protected function log($message, $level = Logger::DEBUG)
    {
        try {
            $this->logger->addRecord($level, $message, $this->getContext());
        } catch (\Exception $e) {

        }
    }
1264291
public function log($message, $level = LogLevel::DEBUG)
    {
        if ($this->logger instanceof LoggerInterface) {
            $this->logger->log($level, $message);
        }
    }
1144412
public function log($message, $level)
    {
        Injector::inst()->get(LoggerInterface::class)->log($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;
    }
1293210
public function log($level, $message, array $context = [])
    {
        if ( ! in_array($level, $this->threshold)) {
            return false;
        }

        // Try to get language message
        $langMessage = language()->getLine($message, $context);

        // Re-Define message
        $message = empty($langMessage) ? $message : $langMessage;

        if ( ! is_dir($this->path)) {
            mkdir($this->path, true, 0775);
        }

        $this->lines[] = new \ArrayObject([
            'level'   => strtoupper($level),
            'time'    => date('r'),
            'message' => $message,
        ], \ArrayObject::ARRAY_AS_PROPS);

        $isNewFile = false;
        $filePath = $this->path . 'log-' . date('d-m-Y') . '.log';

        $log = '';

        if ( ! is_file($filePath)) {
            $isNewFile = true;
        }

        if ( ! $fp = @fopen($filePath, 'ab')) {
            return false;
        }

        $log .= strtoupper($level) . ' - ' . date('r') . ' --> ' . $message . "\n";

        flock($fp, LOCK_EX);

        $result = null;
        for ($written = 0, $length = strlen($log); $written < $length; $written += $result) {
            if (($result = fwrite($fp, substr($log, $written))) === false) {
                break;
            }
        }

        flock($fp, LOCK_UN);
        fclose($fp);

        if ($isNewFile === true) {
            chmod($filePath, 0664);
        }

        return (bool)is_int($result);
    }
266487
public function write($level, $message, $context = null)
	{
		if (!is_string($message))
			throw new \InvalidArgumentException("Message must be a string");

		if ($this->enabled)
		{
			$record = new LogRecord();
			$record->context = $context;
			$record->message = $message;
			$record->loggerName = $this->name;
			$record->level = $level;
			$record->formatted = $this->format;

			$res = $record;
			foreach (self::$settings["parsers"] as $name => $className)
			{
				$inst = new $className($res);
				$res = $inst->parse();
			}

			foreach ($this->writers as $writer)
				$writer->handle($level, $res);
		}
	}
557871
public function logMessage($message, $level = 0) {
        $this->getLogFile();
        if (!flock($this->_fp, LOCK_EX)) {
            throw new LoggerFileException('Can\'t obtain file lock for: ');
        }
        $text = '[' . date("H:i:s") . ']' . $this->_levelNames[$level] . " " . $message . "\n"; // Log message
        if (fwrite($this->_fp, $text)) {
            flock($this->_fp, LOCK_UN);
            return true;
        } else {
            flock($this->_fp, LOCK_UN);
            throw new LoggerFileException('Can\'t write to logfile!');
        }
    }
270787
public function log ($level, $message, array $context = array ()) {
		$this->_log (
			$this->convert_log_level ($level),
			$message,
			$context
		);
	}
1113257
public function log($level, $message, array $context = []) {
		$message = trim($message);
		$summary = Text::truncate($message, 255);

		$data = [
			'type' => $level,
			'summary' => $summary,
			'message' => $message,
			'context' => trim(print_r($context, true)),
			'count' => 1,
		];
		$log = $this->newEntity($data);

		return (bool)$this->save($log);
	}
210119
public static function log($level, $message, array $context = array())
    {
        return self::getInstance()->log($level, $message, $context);
    }
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);
	}
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));
    }
673721
public function log($level, $message, array $context = array())
    {
        try
        {
            return $this->logger->log($level, $message, $context);
        }
        catch (Error $ex)
        {}
        catch (Exception $ex)
        {}

        throw new WriteException("Record with undefined level could not be logged.", 0, $ex);
    }
1014140
protected function write($line, $level = 100)
    {
        $logfile = $this->getFilePath($level);
        $rotator = $this->getRotator($logfile);
        $return = $rotator->write($line);

        if ($this->isErrorLevel($level) && true===$this->duplicate_errors)
            self::write($line, 100);

        return $return;
    }