PageRenderTime 18ms CodeModel.GetById 15ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/Dependencies/log4net/Layout/RawTimeStampLayout.cs

https://bitbucket.org/VirtualReality/software-testing
C# | 74 lines | 23 code | 8 blank | 43 comment | 0 complexity | 6d3bd086ac971d4f09d1138b7a41bd14 MD5 | raw file
 1#region Apache License
 2//
 3// Licensed to the Apache Software Foundation (ASF) under one or more 
 4// contributor license agreements. See the NOTICE file distributed with
 5// this work for additional information regarding copyright ownership. 
 6// The ASF licenses this file to you under the Apache License, Version 2.0
 7// (the "License"); you may not use this file except in compliance with 
 8// the License. You may obtain a copy of the License at
 9//
10// http://www.apache.org/licenses/LICENSE-2.0
11//
12// Unless required by applicable law or agreed to in writing, software
13// distributed under the License is distributed on an "AS IS" BASIS,
14// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15// See the License for the specific language governing permissions and
16// limitations under the License.
17//
18#endregion
19
20using System;
21using System.Text;
22
23using log4net.Core;
24using log4net.Util;
25
26namespace log4net.Layout
27{
28	/// <summary>
29	/// Extract the date from the <see cref="LoggingEvent"/>
30	/// </summary>
31	/// <remarks>
32	/// <para>
33	/// Extract the date from the <see cref="LoggingEvent"/>
34	/// </para>
35	/// </remarks>
36	/// <author>Nicko Cadell</author>
37	/// <author>Gert Driesen</author>
38	public class RawTimeStampLayout : IRawLayout
39	{
40		#region Constructors
41
42		/// <summary>
43		/// Constructs a RawTimeStampLayout
44		/// </summary>
45		public RawTimeStampLayout()
46		{
47		}
48
49		#endregion
50  
51		#region Implementation of IRawLayout
52
53		/// <summary>
54		/// Gets the <see cref="LoggingEvent.TimeStamp"/> as a <see cref="DateTime"/>.
55		/// </summary>
56		/// <param name="loggingEvent">The event to format</param>
57		/// <returns>returns the time stamp</returns>
58		/// <remarks>
59		/// <para>
60		/// Gets the <see cref="LoggingEvent.TimeStamp"/> as a <see cref="DateTime"/>.
61		/// </para>
62		/// <para>
63		/// The time stamp is in local time. To format the time stamp
64		/// in universal time use <see cref="RawUtcTimeStampLayout"/>.
65		/// </para>
66		/// </remarks>
67		public virtual object Format(LoggingEvent loggingEvent)
68		{
69			return loggingEvent.TimeStamp;
70		}
71
72		#endregion
73	}
74}