using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Sog.Properties; namespace Sog { public class Program { public static void Main(string[] args) { //long iNow = DateTimeOffset.Now.ToUnixTimeSeconds(); bool bServerRunMode = false; ServerEntry entry = null; try { // var rm = new global::System.Resources.ResourceManager("MySql.Data.Resources", typeof(Program).Assembly); string err = Resources.ReadFromStreamFailed; AppParam appParam = new AppParam(args); if(appParam.RunMode == AppRunMode.Run) { bServerRunMode = true; } //Console.ReadLine(); entry = new ServerEntry(appParam); entry.Start(); } catch (Exception ex) { if(bServerRunMode) { TraceLog.Exception(ex, true); if (ex.InnerException != null) { TraceLog.Exception(ex.InnerException, true); } //告警 entry.GetApp().Alerter.AlertException(ex); } else { Console.WriteLine(ex.Message); Console.WriteLine(ex.StackTrace); } System.Threading.Thread.Sleep(500); } } } }