public static void LogHardwareInfo()
        {
            try
            {
                foreach (var hardware in hardwares)
                {
                    var searcher = new ManagementObjectSearcher("SELECT * FROM " + hardware);

                    var hardwareLog = SafeLog.GetLogger(hardware);

                    foreach (ManagementObject managementObject in searcher.Get())
                    {
                        var searcherProperties = managementObject.Properties;
                        foreach (var property in searcherProperties)
                        {
                            hardwareLog.Info(property.Name + ' ' + property.Value);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                log.Error("logging hardware info", ex);
            }
        }
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            //Theme.Initialize();

            Program.InitializeUnhandledExceptionHandler();

            var versionLog = SafeLog.GetLogger("Version");

            versionLog.Info(Assembly.GetExecutingAssembly().GetName().Version.ToString());

            Program.LogHardwareInfo();

#if (DEBUG)
            App.RunInDebugMode();
#else
            try
            {
                App.RunInReleaseMode();
            }
            catch (ReflectionTypeLoadException ex)
            {
                log.Fatal("exception(s) occurred while loading reflection type", ex);
                for (var i = 0; i < ex.LoaderExceptions.Length; ++i)
                {
                    log.Fatal(i, ex.LoaderExceptions[i]);
                }
            }
#endif
            this.ShutdownMode = ShutdownMode.OnMainWindowClose;
        }
 public static ILog GetLogger(this Type type)
 {
     return(_loggers.GetOrCreate(type, t => SafeLog.GetLogger(t.Name)));
 }