/// <summary> /// Write Log /// </summary> /// <param name="category">category</param> /// <param name="log">log</param> /// <param name="e">exception</param> public static void WriteLog(ELogCategory category, object log = null, Exception e = null) { switch (category) { case ELogCategory.Debug: if (debugLogger.IsDebugEnabled) { if (log != null) { if (e != null) { debugLogger.Debug(log, e); } else { debugLogger.Debug(log); } } else { if (e != null) { debugLogger.Debug(e); } } } break; case ELogCategory.Info: if (infoLogger.IsInfoEnabled) { if (log != null) { if (e != null) { infoLogger.Info(log, e); } else { infoLogger.Info(log); } } else { if (e != null) { infoLogger.Info(e); } } } break; case ELogCategory.Warn: if (WarnLogger.IsWarnEnabled) { if (log != null) { if (e != null) { WarnLogger.Warn(log, e); } else { WarnLogger.Warn(log); } } else { if (e != null) { WarnLogger.Warn(e); } } } break; case ELogCategory.Error: if (errorLogger.IsErrorEnabled) { if (log != null) { if (e != null) { errorLogger.Error(log, e); } else { errorLogger.Error(log); } } else { if (e != null) { errorLogger.Error(e); } } } break; case ELogCategory.Fatal: if (fatalLogger.IsFatalEnabled) { if (log != null) { if (e != null) { fatalLogger.Fatal(log, e); } else { fatalLogger.Fatal(log); } } else { if (e != null) { fatalLogger.Fatal(e); } } } break; case ELogCategory.Sql: if (sqlLogger.IsInfoEnabled) { if (log != null) { if (e != null) { sqlLogger.Info(log, e); } else { sqlLogger.Info(log); } } else { if (e != null) { sqlLogger.Info(e); } } } break; case ELogCategory.Security: if (securityLogger.IsInfoEnabled) { if (log != null) { if (e != null) { securityLogger.Info(log, e); } else { securityLogger.Info(log); } } else { if (e != null) { securityLogger.Info(e); } } } break; } }
public static void Warn(string message) { WarnLogger.Warn(message); }