示例#1
0
        protected virtual void SetupLogging()
        {
            TraceSource trace = Log.Trace(Name);

            trace.Switch.Level = SourceLevels.All;

            string logFilePath = string.Format("Logs\\{0}.{1}.log", Environment.MachineName, Name);
            DailyTextWriterListener dailyListener = new DailyTextWriterListener(logFilePath);

            trace.Listeners.Add(dailyListener);
        }
示例#2
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            TraceSource trace = XyratexOSC.Logging.Log.Trace();

            trace.Switch.Level = SourceLevels.All;

            string logFileDirectory = "C:\\Seagate\\HGA.HST\\Log\\";
            string logFilePath      = string.Format("{0}{1}.BenchTestsTool.log", logFileDirectory, Environment.MachineName);

            if (!Directory.Exists(logFileDirectory))
            {
                Directory.CreateDirectory(logFilePath);
            }
            DailyTextWriterListener dailyListener = new DailyTextWriterListener(logFilePath);

            trace.Listeners.Add(dailyListener);

            Application.Run(new frmMain());
        }
示例#3
0
        public override void Startup()
        {
            try
            {
                _workcell = new HSTWorkcell();

                TraceSource trace = Log.Trace();
                trace.Switch.Level = SourceLevels.All;
                string logName = string.Format("{0}\\{1}.HST.log", HSTMachine.Workcell.HSTSettings.Directory.LogFilePath, HSTMachine.Workcell.HSTSettings.Install.EquipmentID /*Environment.MachineName*/);
                DailyTextWriterListener listener = new DailyTextWriterListener(logName);
                trace.Listeners.Add(listener);
                LogStartup();

                RegisterWorkcell(HSTMachine.Workcell);
                HSTMachine.Workcell.instantiateWorkOrder();
                ServiceManager.Tracing.Trace("Loaded Workcell: " + HSTMachine.Workcell.SlotName);
            }
            catch (Exception ex)
            {
                string msg = ServiceManager.ErrorHandler.GetExceptionMessages(ex);
                Notify.PopUpError("Startup error", "Failed to load module: " + HSTMachine.Workcell.SlotName + "\nError: " + msg + "\r\n\r\n" + ex);
            }
            base.Startup();
        }