public static function prepareForLogging($data)
    {
        if (empty($data)) {
            return [];
        }

        // If not an array, wrap it as an array
        if (!is_array($data)) {
            return [$data];
        }

        if (self::config()->logStyle == self::LOGSTYLE_SIMPLE) {
            return array_filter([
                isset($data['Message']) ? $data['Message'] : null,
                isset($data['Code']) ? $data['Code'] : null
            ]);
        }

        if (Director::isLive() || self::config()->logStyle == self::LOGSTYLE_VERBOSE) {
            self::sanitize($data);
        }

        return $data;
    }
public static function prepareForLogging($data)
    {
        if (empty($data)) {
            return [];
        }

        // If not an array, wrap it as an array
        if (!is_array($data)) {
            return [$data];
        }

        if (self::config()->logStyle == self::LOGSTYLE_SIMPLE) {
            return array_filter([
                isset($data['Message']) ? $data['Message'] : null,
                isset($data['Code']) ? $data['Code'] : null
            ]);
        }

        if (Director::isLive() || self::config()->logStyle == self::LOGSTYLE_VERBOSE) {
            self::sanitize($data);
        }

        return $data;
    }
public static function prepareForLogging ( $ data ) { if ( empty ( $ data ) ) { return [ ] ; } // If not an array, wrap it as an array if ( ! is_array ( $ data ) ) { return [ $ data ] ; } if ( self :: config ( ) -> logStyle == self :: LOGSTYLE_SIMPLE ) { return array_filter ( [ isset ( $ data [ 'Message' ] ) ? $ data [ 'Message' ] : null , isset ( $ data [ 'Code' ] ) ? $ data [ 'Code' ] : null ] ) ; } if ( Director :: isLive ( ) || self :: config ( ) -> logStyle == self :: LOGSTYLE_VERBOSE ) { self :: sanitize ( $ data ) ; } return $ data ; }
Prepare data for logging by cleaning up the data or simplify it.
@param mixed $data the incoming data to log
@return array processed data for logging
Prepare data for logging by cleaning up the data or simplify it .