コード例 #1
0
        public static void Log(params Exception[] exception)
        {
            var ri = new ExceptionReportInfo();

            ri.SetExceptions(exception);
            var rg = new ExceptionReportGenerator(ri);

            Log(rg.CreateExceptionReport());
        }
コード例 #2
0
        public ExceptionReportGenerator(ExceptionReportInfo reportInfo)
        {
            if (reportInfo == null)
            {
                throw new ExceptionReportGeneratorException("reportInfo cannot be null");
            }

            _reportInfo = reportInfo;

            _reportInfo.ExceptionDate = DateTime.UtcNow;
            _reportInfo.UserName      = Environment.UserName;
            _reportInfo.MachineName   = Environment.MachineName;

            if (_reportInfo.AppAssembly == null)
            {
                _reportInfo.AppAssembly = Assembly.GetEntryAssembly() ?? Assembly.GetCallingAssembly();
            }
        }
コード例 #3
0
 public ExceptionReportBuilder(ExceptionReportInfo reportInfo, IEnumerable <SysInfoResult> sysInfoResults)
     : this(reportInfo)
 {
     _sysInfoResults = sysInfoResults;
 }
コード例 #4
0
 public ExceptionReportBuilder(ExceptionReportInfo reportInfo)
 {
     _reportInfo = reportInfo;
 }