Skip to content

Commit 65bab2d

Browse files
committed
* Added application logs
1 parent b9bc9db commit 65bab2d

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed

MemPlus/Classes/LOG/Log.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System;
2+
3+
namespace MemPlus.Classes.LOG
4+
{
5+
internal class Log
6+
{
7+
private readonly DateTime _time;
8+
private readonly string _value;
9+
10+
internal Log(string data)
11+
{
12+
_time = DateTime.Now;
13+
_value = data;
14+
}
15+
16+
internal DateTime GetDate()
17+
{
18+
return _time;
19+
}
20+
21+
internal string GetValue()
22+
{
23+
return _value;
24+
}
25+
}
26+
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
using System;
2+
using System.Collections.Generic;
3+
4+
namespace MemPlus.Classes.LOG
5+
{
6+
internal class LogController
7+
{
8+
private readonly List<Log> _logList;
9+
10+
internal LogController()
11+
{
12+
_logList = new List<Log>();
13+
}
14+
15+
internal void AddLog(Log l)
16+
{
17+
_logList.Add(l);
18+
}
19+
20+
internal void RemoveLog(Log l)
21+
{
22+
if (_logList.Contains(l))
23+
{
24+
_logList.Remove(l);
25+
}
26+
else
27+
{
28+
throw new ArgumentException("Log could not be found!");
29+
}
30+
}
31+
32+
internal void ClearLogs()
33+
{
34+
_logList.Clear();
35+
}
36+
37+
internal List<Log> GetLogs()
38+
{
39+
return _logList;
40+
}
41+
}
42+
}

0 commit comments

Comments
 (0)