public static void WriteLog(LogParameter lp) { try { if (Config.LogLevel <= lp.Level) { if ((Config.LogType & Config.DataBase_Log) > 0) { WriteDatabaseLog(lp); } if ((Config.LogType & Config.Txt_Log) > 0) { WriteTxtLog(lp); } if ((Config.LogType & Config.Show_Log) > 0) { WriteShowLog(lp); } } } catch (Exception e) { Console.WriteLine(e.Message); Console.WriteLine(e.StackTrace); Console.WriteLine(lp.Msg); } }
private static void WriteDatabaseLog(LogParameter lp) { }
private static void WriteShowLog(LogParameter lp) { Console.WriteLine(lp.Msg); }
private static void WriteTxtLog(LogParameter lp) { File.AppendAllText(Config.LogPath, lp.Msg); }