Logs warning or more critical messages.

@param ...$params  If a single parameter is passed, treats as a string, otherwise acts as sprintf

@return void
969045
public static function warning(...$params): void
    {
        if(self::$verbosity < 1) {
            return;
        }
        $msg = self::processParams($params);
        if(isset(self::$logger)) {
            self::$logger->warning($msg);
        } else {
            echo $msg.PHP_EOL;
        }
    }
688449
public function warning(string $message)
    {
        if ($this->status == 'ok') {
            $this->status = 'warning';
        }

        $this->warnings[] = $message;
    }
144963
public function warn($msg) {
		$this->mailMessage(self::LEVEL_WARN, $msg);

		if($this->checkLevel($this->loglevels, self::LEVEL_WARN) !== true)
			return;

		$this->writeMessage(self::LEVEL_WARN, $msg);
	}
1347777
private function log($method, $sql = null, $params = null)
    {
        $this->_logger->info(
            str_pad('('.$method.')', 14, ' ', STR_PAD_RIGHT).'"'.$sql.'"',
            (array) $params
        );

        /*
        $arg1formatted = is_string($arg1) ? str_replace([
            'SELECT ',
            ', ',
            'FROM ',
            'LEFT JOIN ',
            'WHERE ',
            'LIMIT ',
        ], [
            'SELECT ',
            "\n".'                         , ',
            "\n".'                      FROM ',
            "\n".'                 LEFT JOIN ',
            "\n".'                     WHERE ',
            "\n".'                     LIMIT ',
        ], trim($arg1)) : json_encode($arg1);

        echo '<pre style="border:1px solid #9F6000;margin:0 0 1px 0;padding:2px 6px 3px 6px;color:#9F6000;background:#FEEFB3;">';
        echo '<strong>'.str_pad($method,12,' ',STR_PAD_LEFT).'</strong>'.($arg1?': #1 -> '.$arg1formatted:'');
        if (isset($arg2)) {
            echo "\n".str_pad('#2 -> ',20,' ',STR_PAD_LEFT).json_encode($arg2);
        }
        echo '</pre>';
        */
    }
1239721
protected function setParams($params)
    {
        $this->params = $this->default_params;
        foreach ($params as $name => $value) {
            $method = 'set' . str_replace(' ', '', ucwords(str_replace('_', ' ', strtolower($name))));
            if (!method_exists($this, $method)) {
                throw new Exception\InvalidArgumentException(__METHOD__ . " Parameter '$name' does not exists.");
            }
            $this->$method($value);
        }
    }
1355738
private function _castInputParametersWithClosure($params) {
		$allowed_params = $this->_getAllowedParams();		
		foreach($params as $name => $value) {
			$array_idx = $name;
			$found = false;
			$found |= $this->_valueInArray($name, array_keys($allowed_params), $array_idx);
			$found |= $this->_valueInArray($this->_path . "[" . $name . "]", array_keys($allowed_params), $array_idx);
			// XML Response can't have dashes
			$found |= $this->_valueInArray(str_replace('-', '_', $name), array_keys($allowed_params), $array_idx);
			$found |= $this->_valueInArray($this->_path . "[" . str_replace('-', '_', $name) . "]", array_keys($allowed_params), $array_idx);

      if($found) {
        $closure = $allowed_params[$array_idx];
        $this->$array_idx = $closure ? $closure($value, $params) : $value;
      }
      if($array_idx == 0) {
        //print_r($params);
      }
		}
	}
466007
private function validateAndSetBotParamsSpecial(array $params)
    {
        // Special case, where secret MUST be defined if we have a webhook.
        if (($params['webhook']['url'] ?? null) && !($params['secret'] ?? null)) {
            // This does not apply when using CLI, but make sure it gets tested for!
            if ('cli' !== PHP_SAPI || BotManager::inTest()) {
                throw new InvalidParamsException('Some vital info is missing: secret');
            }
        }
    }
1190194
public function warning($message): void
	{
		$message = $this->logMessToArray($message);
		$this->log(array_merge(['SEVERITY' => 'WARNING'], $message));
	}
477467
public function log(string $sql, array $parameters = []): void
    {
        $message = sprintf('[SQL]: %s', $this->removeWhitespace($sql));
        $this->logger->log($this->logLevel, $message, $parameters);
    }
736072
public static function info(...$messages): void
    {
        static::init();

        if (!static::isTemporaryDisabled('info')) {
            foreach (static::$adapters as $adapter) {
                /* @var $adapter \Koldy\Log\Adapter\AbstractLogAdapter */
                if ($adapter->isLevelEnabled(self::INFO)) {
                    $adapter->info((new Message(self::INFO))->setMessages($messages));
                }
            }
        }
    }
1294370
public function save(array $params)
    {
        foreach ($params as $method => $param) {
            if (is_array($param) && isset($param[0])) {
                call_user_func_array([$this, $method], $param);
            } else {
                $this->{$method}($param);
            }
        }
    }
402626
public static function makeLog($message, array $context = [], array $params = [])
    {
        self::init($params);
        self::$instance->makeLog($message, $context);
    }
1038603
protected function write($messages): void
    {
        if (! \is_array($messages)) {
            $messages = [$messages];
        }

        foreach ($messages as $i => $message) {
            $messages[$i] = '    - ' . $message;
        }

        $this->io->writeError($messages, true, IOInterface::VERBOSE);
    }
1043566
private function handleException($e, $params) {
		
		// logger
		$this->logParamQuery($this->query, 0, $params);
		
		switch ($e->getCode()) {
		
			// calls with wrong params type or count
			case 'HY093':
				if (is_array($params)) {
					$message = 'Parameters count is ' . count($params) . ', an array with different number is expected by function call';
				} else {
					$message = 'Parameters are expected in array format by function call, type ' . gettype($params) . ' was passed';
				}
				break;
		
			default:
				$message = $e->getMessage();
				break;
		
		}
		
		$this->addError($message);
		
	}
648135
private function initialize($params = array())
	{
		if (count($params) > 0)
		{
			foreach ($params as $key => $value)
			{
				if (isset($this->{$key}))
				{
					$this->{$key} = $value;
				}
				else if (strpos($key, 'CURLOPT_') === 0) 
				{
					curl_setopt($this->ch, $key, $value);    
				}
			}
		}
	}
502585
public function prepare($params)
    {
        $this->params = !empty($params) ? $params[ 0 ] : [ ];

        // force mandatory fields
        $this->filter();
        $this->maxRecords();
    }
1069376
public function logMessage(Message $message) {
        foreach($this->logger as $logger) {
            $logger->logMessage($message);
        }
    }