public static function log($message, $level = self::LOG_DEBUG)
    {
        if (self::hasLogger()) {
            $logger = self::logger();
            switch ($level) {
                case self::LOG_EMERG:
                    return $logger->log($message, $level);
                case self::LOG_ALERT:
                    return $logger->alert($message);
                case self::LOG_CRIT:
                    return $logger->crit($message);
                case self::LOG_ERR:
                    return $logger->err($message);
                case self::LOG_WARNING:
                    return $logger->warning($message);
                case self::LOG_NOTICE:
                    return $logger->notice($message);
                case self::LOG_INFO:
                    return $logger->info($message);
                default:
                    return $logger->debug($message);
            }
        }

        return true;
    }
public static function log($message, $level = self::LOG_DEBUG)
    {
        if (self::hasLogger()) {
            $logger = self::logger();
            switch ($level) {
                case self::LOG_EMERG:
                    return $logger->log($message, $level);
                case self::LOG_ALERT:
                    return $logger->alert($message);
                case self::LOG_CRIT:
                    return $logger->crit($message);
                case self::LOG_ERR:
                    return $logger->err($message);
                case self::LOG_WARNING:
                    return $logger->warning($message);
                case self::LOG_NOTICE:
                    return $logger->notice($message);
                case self::LOG_INFO:
                    return $logger->info($message);
                default:
                    return $logger->debug($message);
            }
        }

        return true;
    }
public static function log ( $ message , $ level = self :: LOG_DEBUG ) { if ( self :: hasLogger ( ) ) { $ logger = self :: logger ( ) ; switch ( $ level ) { case self :: LOG_EMERG : return $ logger -> log ( $ message , $ level ) ; case self :: LOG_ALERT : return $ logger -> alert ( $ message ) ; case self :: LOG_CRIT : return $ logger -> crit ( $ message ) ; case self :: LOG_ERR : return $ logger -> err ( $ message ) ; case self :: LOG_WARNING : return $ logger -> warning ( $ message ) ; case self :: LOG_NOTICE : return $ logger -> notice ( $ message ) ; case self :: LOG_INFO : return $ logger -> info ( $ message ) ; default : return $ logger -> debug ( $ message ) ; } } return true ; }
Logs a message
If a logger has been configured, the logger will be used, otherwrise the
logging message will be discarded without any further action

@param      string The message that will be logged.
@param      string The logging level.

@return bool True if the message was logged successfully or no logger was used.
Logs a message If a logger has been configured the logger will be used otherwrise the logging message will be discarded without any further action