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

Commit ed7f54d

Browse files
committed
[Backend] Hook up core functionality to logger
1 parent dfaf5b8 commit ed7f54d

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

DolphinBisectTool/Backend.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ public void Bisect(string boot_title = "")
4242
string base_url = "https://dl.dolphin-emu.org/builds/dolphin-master-";
4343
int test_index = 0;
4444
int test_direction = 0;
45+
List<String> skipped_builds = new List<string>();
4546
RunBuild run_build = new RunBuild();
47+
Logger log = new Logger();
4648

47-
while (!(m_first_index == m_second_index-1))
49+
while (!(m_first_index == m_second_index - 1))
4850
{
4951

5052
test_index = m_first_index == -1 ? (0 + m_second_index) / 2 : (m_first_index + m_second_index) / 2;
@@ -55,10 +57,13 @@ public void Bisect(string boot_title = "")
5557
try
5658
{
5759
Download(base_url + m_build_list[test_index] + "-x64.7z", m_build_list[test_index]);
60+
log.Write("Testing build " + m_build_list[test_index]);
5861
break;
5962
}
6063
catch (Exception e)
6164
{
65+
log.Write("ERROR. Skipping build " + m_build_list[test_index]);
66+
skipped_builds.Add(m_build_list[test_index]);
6267
BisectError(e.Message);
6368
if (test_direction == 0)
6469
--test_index;
@@ -77,18 +82,26 @@ public void Bisect(string boot_title = "")
7782

7883
if (return_val == UserInput.Yes)
7984
{
85+
log.Write("Build " + m_build_list[test_index] + " marked as a BAD build");
8086
m_first_index = test_index;
8187
test_direction = 1;
8288
}
8389
else if (return_val == UserInput.No)
8490
{
91+
log.Write("Build " + m_build_list[test_index] + " marked as a GOOD build");
8592
m_second_index = test_index;
8693
test_direction = 0;
8794
}
8895
else
8996
return;
9097
}
9198

99+
log.Write("Bisect completed. " + m_build_list[test_index] + " may be the culprit.");
100+
if (!(skipped_builds.Count == 0))
101+
{
102+
string sb = string.Join(", ", skipped_builds.ToArray());
103+
log.Write("Skipped builds: " + sb);
104+
}
92105
UserInput open_url = BisectEvent(test_index, true);
93106

94107
if (open_url == UserInput.Yes)

DolphinBisectTool/Logger.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,14 @@ public Logger()
1717

1818
~Logger()
1919
{
20-
log_file.Close();
20+
// TODO - figure out why closing the file here throws an exception.
21+
try
22+
{
23+
log_file.Close();
24+
}
25+
catch (Exception e)
26+
{
27+
}
2128
}
2229

2330
public void Write(string s)

0 commit comments

Comments
 (0)