aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Logging/ExceptionLogItem.cs
blob: dab06455cb3c102a15ad1e3c983be8874af39816 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22<
using System;
using System.Collections.Generic;
using System.IO
ss="w"> System.Threading.Tasks; namespace Tango.Logging { /// <summary> /// Represents an exception log item. /// </summary> [Serializable] public class ExceptionLogItem : LogItemBase { private bool _messageSet; [NonSerialized] private Exception _exception; /// <summary> /// Gets or sets the log item exception. /// </summary> public Exception Exception { get { return _exception; } set { _exception = value; } } /// <summary> /// Gets the log message. /// </summary> public override string Message { get; set; } /// <summary> /// Gets or sets the error description. /// </summary> public String Description { get; set; } /// <summary> /// Returns a formatted string of the log item. /// </summary> public override string ToString() { return String.Format("[{0}] [{6}] [{1}] [{2}] [{3}]: {4}{5}", TimeStamp.ToString("HH:mm:ss.ff"), GetRelativeCallerFilePath(), CallerMethodName, CallerLineNumber, Description, Environment.NewLine + Exception.FlattenException(), Category); } } }