Mercurial > repos > IBBoard
annotate Logging/LogItem.cs @ 94:6bbcb3ef79d2
Re #47: Add translatable GTK# widgets
* Remove "set" part of Name in translatable interface as not all GTK widgets support it and it isn't necessary
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Tue, 28 Dec 2010 13:52:06 +0000 |
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 } |