Skip to content
This repository was archived by the owner on Jul 9, 2024. It is now read-only.

Commit dfaf5b8

Browse files
committed
[Logger] Dumb simple logging implementation
1 parent d41d25e commit dfaf5b8

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

DolphinBisectTool/DolphinBisectTool.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
<ItemGroup>
7272
<Compile Include="Backend.cs" />
7373
<Compile Include="DownloadBuildList.cs" />
74+
<Compile Include="Logger.cs" />
7475
<Compile Include="MainWindow.cs">
7576
<SubType>Form</SubType>
7677
</Compile>

DolphinBisectTool/Logger.cs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.IO;
4+
using System.Linq;
5+
using System.Text;
6+
7+
namespace DolphinBisectTool
8+
{
9+
class Logger
10+
{
11+
StreamWriter log_file;
12+
13+
public Logger()
14+
{
15+
log_file = new StreamWriter("log-" + DateTime.Now.ToString("yyyy-MM-dd_hhmmss") + ".txt");
16+
}
17+
18+
~Logger()
19+
{
20+
log_file.Close();
21+
}
22+
23+
public void Write(string s)
24+
{
25+
log_file.WriteLine(s);
26+
log_file.Flush();
27+
}
28+
29+
}
30+
}

0 commit comments

Comments
 (0)