Beispiel #1
0
        /// <summary>
        /// format l'exception seulement
        /// </summary>
        /// <param name="Log"></param>
        /// <param name="ex"></param>
        public static string FormatException(this log4net.ILog Log, Exception ex)
        {
            string mess = string.Empty;

            try
            {
                mess = new TextExceptionFormatter(ex).Format();
            }
            catch (Exception)
            {
                mess = "TextExceptionFormatter().Format() failed !";
            }
            return(mess);
        }
Beispiel #2
0
        /// <summary>
        /// format l'exception seulement
        /// </summary>
        /// <param name="Log"></param>
        /// <param name="ex"></param>
        public static string FormatException(this ILogger Log, Exception ex)
        {
            string mess = string.Empty;

            try
            {
                mess = new TextExceptionFormatter(ex).Format();
            }
            catch (Exception)
            {
                mess = $@"TextExceptionFormatter().Format() failed for error ""{ex.Message}"" !";
            }
            return(mess);
        }
        /// <summary>
        /// Format une exception en utilisant <see cref="Vp.UE.Common.Logging.TextExceptionFormatter"/>
        /// </summary>
        /// <param name="ex"></param>
        /// <returns></returns>
        public static string FormatException(Exception ex)
        {
            TextExceptionFormatter tef = new TextExceptionFormatter(ex);

            return(tef.Format());
        }