public function log($level, $message, array $context = [])
    {
        // Do not allow users to supply nonsense on the log level
        if (array_key_exists($level, $this->logPrefixesPerLevel) === false) {
            throw new InvalidArgumentException('Console method not recognised');
        }

        // Parse message into a string we can use
        $parsedMessage = $this->parseMessage($message);

        // Examine context, and alter the message accordingly
        $parsedMessage .= $this->parseContext($context);

        // Speak!
        $this->output($this->format($level, $parsedMessage));
    }
public function log($level, $message, array $context = [])
    {
        // Do not allow users to supply nonsense on the log level
        if (array_key_exists($level, $this->logPrefixesPerLevel) === false) {
            throw new InvalidArgumentException('Console method not recognised');
        }

        // Parse message into a string we can use
        $parsedMessage = $this->parseMessage($message);

        // Examine context, and alter the message accordingly
        $parsedMessage .= $this->parseContext($context);

        // Speak!
        $this->output($this->format($level, $parsedMessage));
    }
public function log ( $ level , $ message , array $ context = [ ] ) { // Do not allow users to supply nonsense on the log level if ( array_key_exists ( $ level , $ this -> logPrefixesPerLevel ) === false ) { throw new InvalidArgumentException ( 'Console method not recognised' ) ; } // Parse message into a string we can use $ parsedMessage = $ this -> parseMessage ( $ message ) ; // Examine context, and alter the message accordingly $ parsedMessage .= $ this -> parseContext ( $ context ) ; // Speak! $ this -> output ( $ this -> format ( $ level , $ parsedMessage ) ) ; }
Logs to an arbitrary log level.

We only recognise info/notice/debug/warning/alert/error/emergency/critical levels, anything else will
throw an InvalidArgumentException. Please provide log level via Psr\Log\LogLevel constants to ensure goodness.

Message must be a string-able value.

Context is optional and can contain any arbitrary data as an array. If providing an exception, you MUST provide
it within a key of 'exception'.

@see: http://www.php-fig.org/psr/psr-3/#1-2-message
@see: http://www.php-fig.org/psr/psr-3/#1-3-context

@param mixed  $level
@param string $message
@param array  $context

@return void

@throws InvalidArgumentException
Logs to an arbitrary log level .