Mercurial > repos > IBBoard
annotate Logging/LogItem.cs @ 108:27b6aa1e98e8
Re #12: Document classes and methods
* Document the Constants
(Also - test new Hg repo and hooks)
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sun, 14 Aug 2011 14:34:12 +0100 |
parents | cc7fae81afec |
children |
rev | line source |
---|---|
16 | 1 // This file (LogItem.cs) is a part of the IBBoard library and is copyright 2009 IBBoard. |
2 // | |
3 // The file and the library/program it is in are licensed under the GNU LGPL license, either version 3 of the License or (at your option) any later version. Please see COPYING.LGPL for more information and the full license. | |
4 | |
0
961030992bd2
Initial commit of IBBoard libraries
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
5 using System; |
961030992bd2
Initial commit of IBBoard libraries
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
6 |
961030992bd2
Initial commit of IBBoard libraries
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
7 namespace IBBoard.Logging |
961030992bd2
Initial commit of IBBoard libraries
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
8 { |
37 | 9 public class LogItem |
10 { | |
11 private LogLevel logLevel; | |
12 private string logMessage, stacktrace; | |
13 private DateTime occurance; | |
14 | |
15 public LogItem(LogLevel level, string message) : this(level, message, "") | |
16 { | |
17 } | |
18 | |
19 public LogItem(LogLevel level, string message, string stack) | |
20 { | |
21 logLevel = level; | |
22 logMessage = message; | |
23 occurance = DateTime.Now; | |
24 stacktrace = stack; | |
25 } | |
26 | |
27 public LogLevel Level | |
28 { | |
29 get { return logLevel; } | |
30 } | |
31 | |
32 public string Message | |
33 { | |
34 get { return logMessage; } | |
35 } | |
36 | |
37 public DateTime OccuranceTime | |
38 { | |
39 get { return occurance; } | |
40 } | |
41 | |
42 public override string ToString() | |
43 { | |
44 return OccuranceTime.ToString()+" ("+Level+"): "+Message; | |
45 } | |
46 | |
47 public string StackTrace | |
48 { | |
49 get { return stacktrace; } | |
50 } | |
0
961030992bd2
Initial commit of IBBoard libraries
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
51 } |
961030992bd2
Initial commit of IBBoard libraries
IBBoard <dev@ibboard.co.uk>
parents:
diff
changeset
|
52 } |