Exemple #1
0
 public static void Log(params Exception[] exception)
 {
     var ri = new ExceptionReportInfo();
     ri.SetExceptions(exception);
     var rg = new ExceptionReportGenerator(ri);
     Log(rg.CreateExceptionReport());
 }
        public static void Log(params Exception[] exception)
        {
            var ri = new ExceptionReportInfo();

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

            Log(rg.CreateExceptionReport());
        }
		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();
		}
        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();
            }
        }
 public ExceptionReportBuilder(ExceptionReportInfo reportInfo, IEnumerable <SysInfoResult> sysInfoResults)
     : this(reportInfo)
 {
     _sysInfoResults = sysInfoResults;
 }
 public ExceptionReportBuilder(ExceptionReportInfo reportInfo)
 {
     _reportInfo = reportInfo;
 }
 public ExceptionReportBuilder(ExceptionReportInfo reportInfo, IEnumerable<SysInfoResult> sysInfoResults)
     : this(reportInfo)
 {
     _sysInfoResults = sysInfoResults;
 }
 public ExceptionReportBuilder(ExceptionReportInfo reportInfo)
 {
     _reportInfo = reportInfo;
 }