1 // Copyright 2004-2008 Castle Project - http://www.castleproject.org/
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
15 namespace Castle
.MonoRail
.Framework
.Adapters
21 /// Delegates to ASP.Net TraceContext.
23 public class TraceAdapter
: ITrace
25 private TraceContext trace
;
28 /// Initializes a new instance of the <see cref="TraceAdapter"/> class.
30 /// <param name="traceContext">The trace context.</param>
31 public TraceAdapter(TraceContext traceContext
)
37 /// Logs the specified message on the ASP.Net trace
39 /// <param name="message">The message.</param>
40 public void Warn(String message
)
46 /// Logs the specified message on the ASP.Net trace
48 /// <param name="category">The category.</param>
49 /// <param name="message">The message.</param>
50 public void Warn(String category
, String message
)
52 trace
.Warn(category
, message
);
56 /// Logs the specified message on the ASP.Net trace
58 /// <param name="category">The category.</param>
59 /// <param name="message">The message.</param>
60 /// <param name="errorInfo">The error info.</param>
61 public void Warn(String category
, String message
, Exception errorInfo
)
63 trace
.Warn(category
, message
, errorInfo
);
67 /// Logs the specified message on the ASP.Net trace
69 /// <param name="message">The message.</param>
70 public void Write(String message
)
76 /// Logs the specified message on the ASP.Net trace
78 /// <param name="category">The category.</param>
79 /// <param name="message">The message.</param>
80 public void Write(String category
, String message
)
82 trace
.Write(category
, message
);
86 /// Logs the specified message on the ASP.Net trace
88 /// <param name="category">The category.</param>
89 /// <param name="message">The message.</param>
90 /// <param name="errorInfo">The error info.</param>
91 public void Write(String category
, String message
, Exception errorInfo
)
93 trace
.Write(category
, message
, errorInfo
);