add an hr line in the log
@access public
@param $log string : log file
@return void
@since  3.0
767552
public function addErrorHr($log = LOG_SYSTEM) {
        if (Config::config()['user']['debug']['log']) {
            file_put_contents(APP_LOG_PATH . $log . '.log', "#################### END OF EXECUTION OF http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . " ####################\n", FILE_APPEND | LOCK_EX);
        }
    }
873117
public function log($file, $version)
	{
		$record = array('migration' => $file, 'version' => $version);

		$this->table()->insert($record);
	}
824937
protected function processLogs($logs)
	{
		$text='';
		foreach($logs as $log)
			$text.=$this->formatLogMessage($log[0],$log[1],$log[2],$log[3]);

		$logFile=$this->getLogPath().DIRECTORY_SEPARATOR.$this->getLogFile();
		$fp=@fopen($logFile,'a');
		@flock($fp,LOCK_EX);
		if(@filesize($logFile)>$this->getMaxFileSize()*1024)
		{
			$this->rotateFiles();
			@flock($fp,LOCK_UN);
			@fclose($fp);
			@file_put_contents($logFile,$text,FILE_APPEND|LOCK_EX);
		}
		else
		{
			@fwrite($fp,$text);
			@flock($fp,LOCK_UN);
			@fclose($fp);
		}
	}
628021
public static function initialise(Log $Log = null)
    {
        if (!is_null($Log)) {
            self::$_Log = $Log;
        }

        set_error_handler(array(__CLASS__, 'handler'), error_reporting());
    }
528043
def add_line(self, logevent):
        """"""
        key = None
        self.empty = False
        self.groups.setdefault(key, list()).append(logevent)
209905
public function FormatContent($Log) {
      $Data = $Log['Data'];

      // TODO: Check for a custom log type handler.

      switch ($Log['RecordType']) {
         case 'Activity':
            $Result = $this->FormatKey('Story', $Data);
            break;
         case 'Discussion':
            $Result =
               '<b>'.$this->FormatKey('Name', $Data).'</b><br />'.
               $this->FormatKey('Body', $Data);
            break;
         case 'ActivityComment':
         case 'Comment':
            $Result = $this->FormatKey('Body', $Data);
            break;
         case 'Configuration':
            $Result = $this->FormatConfiguration($Data);
            break;
         case 'Registration':
         case 'User':
            $Result = $this->FormatRecord(array('Email', 'Name'), $Data);
            if ($DiscoveryText = GetValue('DiscoveryText', $Data)) {
               $Result .= '<br /><b>'.T('Why do you want to join?').'</b><br />'.Gdn_Format::Display($DiscoveryText);
            }
            if (GetValue('Banned', $Data)) {
               $Result .= "<br />".T('Banned');
            }
            break;
         default:
            $Result = '';
      }
      return $Result;
   }
138589
public function write(Log $log)
	{
		if ($this->output === null)
		{
			throw new LogicException('You must specify an IOInterface for output first.');
		}

		$this->output->setContent(
			$this->renderer->render($log)
		);
	}
90987
protected function _reportSpecMessage($log)
    {
        $messages = $log->messages();
        $message = end($messages);

        switch ($log->type()) {
            case 'passed':
                $this->write($this->_symbols['ok'], 'light-green');
                $this->write(' ');
                $this->write("{$message}\n", 'dark-grey');
                break;
            case 'skipped':
                $this->write($this->_symbols['ok'], 'light-grey');
                $this->write(' ');
                $this->write("{$message}\n", 'light-grey');
                break;
            case 'pending':
                $this->write($this->_symbols['ok'], 'cyan');
                $this->write(' ');
                $this->write("{$message}\n", 'cyan');
                break;
            case 'excluded':
                $this->write($this->_symbols['ok'], 'yellow');
                $this->write(' ');
                $this->write("{$message}\n", 'yellow');
                break;
            case 'failed':
                $this->write($this->_symbols['err'], 'red');
                $this->write(' ');
                $this->write("{$message}\n", 'red');
                break;
            case 'errored':
                $this->write($this->_symbols['err'], 'red');
                $this->write(' ');
                $this->write("{$message}\n", 'red');
                break;
        }
    }
225319
public function logging( $log = false )
    {
        if ( $log !== false ) {
            if ( ! ini_get('log_errors') ) {
                ini_set('log_errors', true);
            }
            if ( ! ini_get('error_log') ) {
                ini_set('error_log', $log);
            }
        }
    }
258140
public function addEntry(LogEntry $entry)
	{
		echo $this->priorities[$entry->priority] . ': '
			. $entry->message . (empty($entry->category) ? '' : ' [' . $entry->category . ']')
			. $this->line_separator;
	}
750524
public function mergeLog(Log $log)
	{
		/** @var Release $release */
		foreach ($log as $release)
		{
			$name = $release->getName();
			if ($this->hasRelease($name))
			{
				// if it does exist then merge the changes
				$this->mergeRelease($log, $name);
			}
			else
			{
				// If the release does not exist add it
				$this->addRelease($release);
			}
		}
	}
71984
public function setLogsDir(string $logsDir): void
    {
        if (!file_exists($logsDir) || !is_writable($logsDir)) {
            throw new LoggerException('Logs path does not exist or is not writable.');
        }
        $this->logsDir = rtrim($logsDir, '/') . '/';
    }
758719
public function specEnd($log = null)
    {
        switch ($log->type()) {
            case 'passed':
                $this->_write($this->_symbols['dot']);
                break;
            case 'skipped':
                $this->_write('S', 'light-grey');
                break;
            case 'pending':
                $this->_write('P', 'cyan');
                break;
            case 'excluded':
                $this->_write('X', 'yellow');
                break;
            case 'failed':
                $this->_write('F', 'red');
                break;
            case 'errored':
                $this->_write('E', 'magenta');
                break;
        }
    }
226189
public function log(\Imi\Log\Record $record)
    {
        if(in_array($record->getLevel(), $this->levels))
        {
            $this->records[] = $record;
            $this->trySave();
        }
    }
273683
protected function innerWrite($log, $level = 1, $prefix = null) {
        $level = intval($level);
        if(intval($level) < $this->log_level || $this -> out === null){
            return;
        }
        
        $timestamp = time();
        
        $prefix = $prefix === null ? $this->prefix : $prefix;
        
        $tag = $this->tags[$level];
        
        $msg = "[$tag][$timestamp][$prefix] $log; \n";
        
        if (is_callable($this -> out)) {
            $out = $this -> out;
            $out($msg . '<br />');   // if out to page , add the BR, easy to watch 
            return;
        }
        
        fwrite($this -> out, $msg);
    }
1212340
public function clear($log)
    {
        if ($log === 'change') {
            $this->changeRepository->clearLog();
        } elseif ($log === 'system') {
            $this->systemRepository->clearLog();
        } else {
            throw new \UnexpectedValueException("Invalid log type requested: $log");
        }

        $this->app['logger.system']->info(ucfirst($log) . ' log cleared.', ['event' => 'security']);
    }
420835
public function append($log)
    {
        /**
         * @var \ManaPHP\DbInterface $db
         */
        $db = $this->_di->getShared($this->_db);

        $level = $this->logger->getLevel();
        $this->logger->setLevel(Logger::LEVEL_FATAL);
        try {
            $db->insert($this->_table, [
                'host' => $log->host,
                'client_ip' => $log->client_ip,
                'request_id' => $log->request_id,
                'category' => $log->category,
                'level' => $log->level,
                'file' => $log->file,
                'line' => $log->line,
                'message' => $log->message,
                'timestamp' => $log->timestamp - (int)$log->timestamp,
                'created_time' => (int)$log->timestamp]);
        } catch (\Exception $e) {
            null;
        }
        $this->logger->setLevel($level);
    }