Пример #1
0
        /// <summary>
        /// Converts the response to a message suitable for logging.
        /// </summary>
        /// <param name="response">The response object.</param>
        /// <param name="isEnabled">if set to <c>true</c> the message is created.</param>
        /// <returns>The string representation of the response.</returns>
        public static string ToLogMessage(this WMLS_GetFromStoreResponse response, bool isEnabled = false)
        {
            if (!_log.IsDebugEnabled && !isEnabled)
            {
                return(string.Empty);
            }

            var xmlOut = response.XMLout ?? string.Empty;

            xmlOut = WitsmlSettings.TruncateXmlOutDebugSize > 0 && xmlOut.Length > WitsmlSettings.TruncateXmlOutDebugSize
                ? xmlOut.Substring(0, WitsmlSettings.TruncateXmlOutDebugSize) + " ... (truncated)"
                : xmlOut;

            return(string.Format(
                       "{0}: Result: {1}; Message: {2}; XML:{4}{3}{4}",
                       response.GetType().Name,
                       response.Result,
                       response.SuppMsgOut,
                       xmlOut,
                       Environment.NewLine));
        }
 public static bool IsSuccessful(this WMLS_GetFromStoreResponse response)
 => response.Result > 0;
 public static bool IsSuccessful(this WMLS_GetFromStoreResponse response)
 {
     return(response.Result > 0);
 }