public function log($type, $data, $severity = 'info', $translatable = true)
    {
        $message = '';

        if (is_string($data)) {
            $message = $data;
        } elseif (isset($data['message'])) {
            $message = (string) $data['message'];
        }

        $values = array(
            'text' => $message,
            'data' => (array) $data,
            'translatable' => $translatable,
            'type' => mb_substr($type, 0, 255),
            'severity' => mb_substr($severity, 0, 255)
        );

        return $this->add($values);
    }
public function log($type, $data, $severity = 'info', $translatable = true)
    {
        $message = '';

        if (is_string($data)) {
            $message = $data;
        } elseif (isset($data['message'])) {
            $message = (string) $data['message'];
        }

        $values = array(
            'text' => $message,
            'data' => (array) $data,
            'translatable' => $translatable,
            'type' => mb_substr($type, 0, 255),
            'severity' => mb_substr($severity, 0, 255)
        );

        return $this->add($values);
    }
public function log ( $ type , $ data , $ severity = 'info' , $ translatable = true ) { $ message = '' ; if ( is_string ( $ data ) ) { $ message = $ data ; } elseif ( isset ( $ data [ 'message' ] ) ) { $ message = ( string ) $ data [ 'message' ] ; } $ values = array ( 'text' => $ message , 'data' => ( array ) $ data , 'translatable' => $ translatable , 'type' => mb_substr ( $ type , 0 , 255 ) , 'severity' => mb_substr ( $ severity , 0 , 255 ) ) ; return $ this -> add ( $ values ) ; }
Writes a log message to the database
@param string $type
@param array|string $data
@param string $severity
@param boolean $translatable
@return boolean
Writes a log message to the database