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;
    }