public static LogLevel FromName(string name) { string nam = name.ToLower(); var res =new LogLevel(); switch (nam) { case "none": { res = None; } break; case "information": { res = Information; } break; case "warning": { res = Warning; } break; case "error": { res = Error; } break; case "accesscontrol": { res = AccessControl; } break; } return res; }
public Log(long id, string code, LogLevel logLevel, User user, string className, string methodName, string title, string messages) { this.id = id; this.code = code; this.logLevel = logLevel; if (user != null) this.partyId = user.Id; this.className = className; this.methodName = methodName; this.logDate = DateTime.Now; this.logLevelId =(int)logLevel; if (!string.IsNullOrEmpty(title) && title.Length > 200) this.title = title.Substring(0, 199); else this.title = title; if (!string.IsNullOrEmpty(messages) && messages.Length > 4000) this.messages = messages.Substring(0, 3999); else this.messages = messages; }
public EventLog(long id, string code, LogLevel logLevel, User party, string className, string methodName, string title, string messages) : base(id, code, logLevel, party, className, methodName, title, messages) { }
public Log AddExceptionLog(string code, LogLevel logLevel, User user, string className, string methodName, string title, string messages) { var log = new EventLog(0, code, logLevel, user, className, methodName, title, messages); return logManagerService.AddLog(log); }