private function log($msg, $exception = null)
    {
        if (!$this->config->isEnableLog()) {
            return false;
        }

        if (empty($this->logger) && !empty($this->config->getLogFilePath())) {
            $this->logger = new DefaultLogger($this->config->getLogFilePath());
        }

        if ($exception) {
            $this->logger->log(LogLevel::ALERT, $msg, ['exception' => $exception]);
        } else {
            $this->logger->log(LogLevel::DEBUG, $msg, []);
        }

        return true;
    }
private function log($msg, $exception = null)
    {
        if (!$this->config->isEnableLog()) {
            return false;
        }

        if (empty($this->logger) && !empty($this->config->getLogFilePath())) {
            $this->logger = new DefaultLogger($this->config->getLogFilePath());
        }

        if ($exception) {
            $this->logger->log(LogLevel::ALERT, $msg, ['exception' => $exception]);
        } else {
            $this->logger->log(LogLevel::DEBUG, $msg, []);
        }

        return true;
    }
private function log ( $ msg , $ exception = null ) { if ( ! $ this -> config -> isEnableLog ( ) ) { return false ; } if ( empty ( $ this -> logger ) && ! empty ( $ this -> config -> getLogFilePath ( ) ) ) { $ this -> logger = new DefaultLogger ( $ this -> config -> getLogFilePath ( ) ) ; } if ( $ exception ) { $ this -> logger -> log ( LogLevel :: ALERT , $ msg , [ 'exception' => $ exception ] ) ; } else { $ this -> logger -> log ( LogLevel :: DEBUG , $ msg , [ ] ) ; } return true ; }
Log message using PSR Logger, or error_log.
Works only when logging was enabled and log file path was define.
Attempts to create default logger if no logger exists.

@param string $msg Message
@param null|\Exception $exception

@return bool true when logged, false when didn't log
Log message using PSR Logger or error_log . Works only when logging was enabled and log file path was define . Attempts to create default logger if no logger exists .