示例#1
0
        public Log(LogId id, string code, LogLevel logLevel, User user, string className,
                   string methodName, string title, string messages)
        {
            if (id == null)
            {
                throw new ArgumentNullException("id");
            }
            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;

            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;
            }
        }
示例#2
0
文件: LogId.cs 项目: mehabadi/HPMS
 public bool SameValueAs(LogId other)
 {
     return(Guid.Equals(other.Guid));
 }
示例#3
0
 public ExceptionLog(LogId id, string code, LogLevel logLevel, User party, string className,
                     string methodName, string title, string messages)
     : base(id, code, logLevel, party, className, methodName, title, messages)
 {
 }