-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLogRecord.cs
91 lines (87 loc) · 2.03 KB
/
LogRecord.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
namespace NetLog.Logging
{
public class LogRecord
{
private Level level;
private string msg;
private Exception thrownEx;
private long seq;
public Level Level {
get { return level; }
set { level = value; }
}
public string getMessage() { return msg; }
public LogRecord( Level level, string message ) {
this.level = level;
this.msg = message;
millis = DateTime.Now;
}
public LogRecord( Level level, string message, params object[]args ) {
this.level = level;
this.msg = String.Format(message,args);
millis = DateTime.Now;
}
public LogRecord( Level level, Exception ex ) {
this.level = level;
this.msg = ex.Message;
thrownEx = ex;
millis = DateTime.Now;
}
public LogRecord( Level level, Exception ex, String msg ) {
this.level = level;
this.msg = msg;
thrownEx = ex;
millis = DateTime.Now;
}
public LogRecord( Level level, Exception ex, String msg, params object[]args ) {
this.level = level;
this.msg = String.Format(msg,args);
thrownEx = ex;
millis = DateTime.Now;
}
private string loggerName;
public string LoggerName {
get { return loggerName; }
set { loggerName = value; }
}
private DateTime millis;
public DateTime Millis {
get { return millis; }
set { millis = value; }
}
private object[] parms;
public object[] Parameters {
get { return parms; }
set { parms = value; }
}
public long SequenceNumber {
get { lock(this) { return seq; } }
set { seq = value; }
}
private string srcCls;
public string SourceClassName {
get { return srcCls; }
set { srcCls = value; }
}
private string srcMeth;
public String SourceMethodName {
get { return srcMeth; }
set { srcMeth = value; }
}
private int thid;
public int ThreadId {
get { return thid; }
set { thid = value; }
}
public Exception Thrown {
get { return thrownEx; }
set { thrownEx = value; }
}
}
}