@param int              $hook_level
@param LogDataInterface $log

@return LogDataInterface
975419
private function maybe_raise_level( $hook_level, LogDataInterface $log ) {

		if ( $hook_level > $log->level() ) {
			return new Log( $log->message(), $hook_level, $log->channel(), $log->context() );
		}

		return $log;
	}
770074
function getLogLevel(level, action, payload, type) {
  switch (typeof level) {
  case 'object':
    return typeof level[type] === 'function' ? level[type](...payload) : level[type]
  case 'function':
    return level(action)
  default:
    return level
  }
}
169598
function log($level, $message, array $context = array())
	{
		foreach($this->_loggers as $logger)
			$logger->log($level, $message, $context);

		return $this;
	}
355601
public function log($level, $message, array $context = [])
    {
        $requestId = isset($context['requestId']) ? $context['requestId'] : uniqid('eight_points_guzzle_');

        if (array_key_exists($requestId, $this->messages)) {
            $logMessage = $this->messages[$requestId];
        } else {
            $logMessage = new LogMessage($message);
        }

        $logMessage->setLevel($level);

        if (!empty($context)) {
            if (!empty($context['request'])) {
                $logMessage->setRequest(new LogRequest($context['request']));
            }

            if (!empty($context['response'])) {
                $logMessage->setResponse(new LogResponse($context['response']));
            }
        }

        $this->messages[$requestId] = $logMessage;
    }
1202814
public function log($level, $message, array $context = [])
    {
        if (!Container::get('config')->get('app_debug') && $level != 'APP') {
            return;
        }

        // build a replacement array with braces around the context keys
        $replace = [];
        foreach ($context as $key => $val) {
            // check that the value can be casted to string
            if (!is_array($val) && (!is_object($val) || method_exists($val, '__toString'))) {
                $replace['{' . $key . '}'] = $val;
            }
        }

        $message = strtr($message, $replace);
        $message = date('[Y-m-d H:i:s]') . "\r\n" . "[{$level}]" . "\r\n" . $message . "\r\n\r\n";
        $logPath = Container::get('config')->get('app_full_path') . '/logs';
        if (!file_exists($logPath)) {
            Helper::mkdirs($logPath);
        }

        if (file_exists($logPath)) {
            file_put_contents($logPath . '/' . date('Ymd') . '.log', $message, FILE_APPEND);
        }
    }
979632
public function log($level, $message, array $context = [])
    {
        if (!$this->enabled) {
            return;
        }
        $message = self::replace($message, $context);
        if (is_resource($this->resource)) {
            fwrite($this->resource, "[{$level}] " . $message. "\n");
        } elseif (is_callable($this->resource)) {
            call_user_func($this->resource, "[{$level}] {$message}\n");
        } else {
            echo "[{$level}] {$message}\n";
        }
    }
1369486
public static function log($loggable, $level, array $context = []) {
        self::init();

        // Wrap everything in a try-catch block to prevent user generated log messages from getting lost if logging fails.
        try {
            // block recursive calls
            // TODO: instead of recursive calls block duplicate messages
            static $isActive = false;
            if ($isActive) throw new RuntimeException('Detected recursive call of '.__METHOD__.'(), aborting...');
            $isActive = true;                                           // lock the method

            // validate parameters
            if (!is_string($loggable)) {
                if (!is_object($loggable))                   throw new IllegalTypeException('Illegal type of parameter $loggable: '.gettype($loggable));
                if (!method_exists($loggable, '__toString')) throw new IllegalTypeException('Illegal type of parameter $loggable: '.get_class($loggable).'::__toString() not found');
                if (!$loggable instanceof \Exception)
                    $loggable = (string) $loggable;
            }
            if (!is_int($level))                            throw new IllegalTypeException('Illegal type of parameter $level: '.gettype($level));
            if (!isset(self::$logLevels[$level]))           throw new InvalidArgumentException('Invalid argument $level: '.$level.' (not a loglevel)');

            $filtered = false;

            // filter messages below the active loglevel
            if (!$filtered && $level!=L_FATAL) {                                // L_FATAL (highest) can't be below
                if (!key_exists('class', $context))                             // resolve the calling class and check its loglevel
                    self::resolveLogCaller($context);
                $filtered = $level < self::getLogLevel($context['class']);      // message is below the active loglevel
            }

            // filter "headers already sent" errors triggered by a previously printed HTML log message
            if (!$filtered && !CLI && self::$printCounter && $loggable instanceof \Exception) {
                if (preg_match('/- headers already sent (by )?\(output started at /', $loggable->getMessage())) {
                    $filtered = true;
                }
            }

            // invoke all active log handlers
            if (!$filtered) {
                if ($level == L_FATAL) $printHandler = 'printFatalHandler';
                else                   $printHandler = 'printNonfatalHandler';

                self::${$printHandler} && self::invokePrintHandler   ($loggable, $level, $context);
                self::$mailHandler     && self::invokeMailHandler    ($loggable, $level, $context);
                self::$smsHandler      && self::invokeSmsHandler     ($loggable, $level, $context);
                self::$errorLogHandler && self::invokeErrorLogHandler($loggable, $level, $context);
            }

            // unlock the method
            $isActive = false;

        }
        catch (\Exception $ex) {
            // Prevent user generated log messages from getting lost if logging fails. In the context of this method
            // only exceptions logged with L_FATAL are not user generated (i.e. they are generated by the registered
            // exception handler).
            if ($level!=L_FATAL || !$loggable instanceof \Exception) {
                $file = key_exists('file', $context) ? $context['file'] : '';
                $line = key_exists('line', $context) ? $context['line'] : '';
                $msg  = 'PHP ['.strtoupper(self::$logLevels[$level]).'] '.$loggable.NL.' in '.$file.' on line '.$line;
                error_log(trim($msg), ERROR_LOG_DEFAULT);
            }
            throw $ex;
        }
    }
768299
def set_log_level(self, level=logging.INFO):
        
        mod, cls = self.parse_module_class()
        logging.getLogger(mod).setLevel(level)
166247
public function tLog(string $level, string $message, array $context = []) {
        $logtag = $this->getLogTag();
        if (is_array($message) || is_object($message)) {
            $message = print_r($message, true);
        }
        $this->log($level, "[{time}] [{$logtag}] ".$message, $context);
    }
364002
private function getSyslogPriority(\n2n\log4php\LoggerLevel $level) {
		if($this->overridePriority) {
			return $this->intPriority;
		}
		return $level->getSyslogEquivalent();
	}
169350
private function insert_log( $level, $log_level, $data ) {
		if ( empty( $log_level[ $level ]['is_valid_log'] ) ) {
			return;
		}
		if ( $this->apply_filters( 'save___log_term' ) <= 0 ) {
			return;
		}
		$this->app->db->insert( '__log', $data );
	}
1154320
public function listLog($level = Logger::LOG_LEVEL_ALL, $includeContext = true, $time = 0)
    {
        $list = $this->logFile->listLog($level, $time);
        $result = [];
        foreach ($list as $entry) {
            if (isset($entry['dumpfile'])) {

                if ($includeContext) {
                    /** @var DumpFile $dumpFile */
                    $dumpFile = $entry['dumpfile'];

                    $entry['context'] = $dumpFile->getUnSerializedContent()[0];
                }


                unset($entry['dumpfile']);

            }
            $result[] = $entry;

        }

        return $result;
    }
499681
public function log($level, $message, array $context = array())
    {
        $eol = isset($context['newLine']) && $context['newLine'] === false ? '' : PHP_EOL;
        
        if ($this->addLeveLMarkersToMessage && !empty($level)) {
            echo '<',$level,'>',$message,'</',$level,'>',$eol;
        } else {
            echo $message,$eol;
        }
    }
1209620
public static void addDeepLogger(Object object, Level level)
    {
        addDeepLogger(object, m -> logger.log(level, m));
    }
821908
public function log($level, $message, array $context = array())
	{
		if ($this->verbose) {
			fwrite(
				STDOUT,
				'[' . $level . '] [' . strftime('%T %Y-%m-%d') . '] ' . $this->interpolate($message, $context) . PHP_EOL
			);
			return;
		}

		if (!($level === Psr\Log\LogLevel::INFO || $level === Psr\Log\LogLevel::DEBUG)) {
			fwrite(
				STDOUT,
				'[' . $level . '] ' . $this->interpolate($message, $context) . PHP_EOL
			);
		}
	}
393009
public function merge( LogDataInterface $log ) {

		$log_data = [
			self::MESSAGE => $log->message(),
			self::LEVEL   => $log->level(),
			self::CHANNEL => $log->channel(),
			self::CONTEXT => $log->context(),
		];

		return $this->merge_array( $log_data );
	}
1016545
public function log($level, $message, array $context = array())
	{
		// Make sure the log level is valid
		if (!array_key_exists($level, $this->priorityMap))
		{
			throw new InvalidArgumentException('An invalid log level has been given.');
		}

		// Map the level to Joomla's priority
		$priority = $this->priorityMap[$level];

		$category = null;
		$date     = null;

		// If a message category is given, map it
		if (!empty($context['category']))
		{
			$category = $context['category'];
		}

		// If a message timestamp is given, map it
		if (!empty($context['date']))
		{
			$date = $context['date'];
		}

		// Joomla's logging API will only process a string or a LogEntry object, if $message is an object without __toString() we can't use it
		if (!\is_string($message) && !($message instanceof LogEntry))
		{
			if (!\is_object($message) || !method_exists($message, '__toString'))
			{
				throw new InvalidArgumentException(
					'The message must be a string, a Joomla\Log\LogEntry object, or an object implementing the __toString() method.'
				);
			}

			$message = (string) $message;
		}

		// And add the log entry
		$this->logger->add($message, $priority, $category, $date, $context);
	}