2002-04-11 Patrik Torstensson <patrik.torstensson@labs2.com>
[mono.git] / mcs / class / System.Web / System.Web / TraceContext.cs
1 // \r
2 // System.Web.TraceContext\r
3 //\r
4 // Author:\r
5 //   Patrik Torstensson (Patrik.Torstensson@labs2.com)\r
6 //\r
7 using System;\r
8 \r
9 namespace System.Web {\r
10    public sealed class TraceContext {\r
11       private HttpContext _Context;\r
12       private bool _Enabled;\r
13       private TraceMode _Mode;\r
14 \r
15       public TraceContext(HttpContext Context) {\r
16          _Context = Context;\r
17          _Enabled = true;\r
18       }\r
19 \r
20       public bool IsEnabled {\r
21          get {\r
22             return _Enabled;\r
23          }\r
24 \r
25          set {\r
26             _Enabled = value;\r
27          }\r
28       }\r
29 \r
30       public TraceMode TraceMode {\r
31          get {\r
32             return _Mode;\r
33          }\r
34 \r
35          set {\r
36             _Mode = value;\r
37          }\r
38       }\r
39 \r
40       public void Warn(string msg) {\r
41          Write(String.Empty, msg, null, true);\r
42       }\r
43 \r
44       public void Warn(string category, string msg) {\r
45          Write(category, msg, null, true);\r
46       }\r
47 \r
48       public void Warn(string category, string msg, Exception error) {\r
49          Write(category, msg, error, true);\r
50       }\r
51 \r
52       public void Write(string msg) {\r
53          Write(String.Empty, msg, null, true);\r
54       }\r
55 \r
56       public void Write(string category, string msg) {\r
57          Write(category, msg, null, true);\r
58       }\r
59 \r
60       public void Write(string category, string msg, Exception error) {\r
61          Write(category, msg, error, true);\r
62       }\r
63 \r
64       [MonoTODO("Save the data into a web dataset directly...")]\r
65       public void Write(string category, string msg, Exception error, bool Warning) {\r
66          throw new NotImplementedException();\r
67       }\r
68    }\r
69 }\r