forked from KSP-KOS/KOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLogger.cs
More file actions
39 lines (33 loc) · 732 Bytes
/
Copy pathLogger.cs
File metadata and controls
39 lines (33 loc) · 732 Bytes
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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace kOS
{
public class Logger
{
protected SharedObjects _shared;
public Logger()
{
}
public Logger(SharedObjects shared)
{
_shared = shared;
}
public virtual void Log(string text)
{
LogToScreen(text);
}
public virtual void Log(Exception e)
{
LogToScreen(e.Message);
}
protected void LogToScreen(string text)
{
if (_shared != null && _shared.Screen != null)
{
_shared.Screen.Print(text);
}
}
}
}