LogOut.cs
1.0 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using System;
namespace Model
{
public static class LogOut
{
private static log4net.ILog LOG;
public static System.Windows.Forms.TextBox LogBox { set; get; }
public static void Init(string name)
{
LOG = log4net.LogManager.GetLogger(name);
}
public static void UIShow(string s)
{
if (LogBox == null) return;
string time = string.Format("[{0:HH:mm:ss}] ", DateTime.Now);
LogBox.AppendText(time + s + "\r\n");
LogBox.ScrollToCaret();
}
public static void Error(string s, Exception ex)
{
LOG.Error(s, ex);
}
public static void Debug(string s)
{
LOG.Debug(s);
}
public static void Info(string s)
{
LOG.Info(s);
}
public static void Fatal(string s, Exception ex)
{
LOG.Fatal(s, ex);
}
public static void Warn(string s)
{
LOG.Warn(s);
}
}
}