Make gamedb's WriteLine flooding conditional on DEBUG

This commit is contained in:
YoshiRulz 2020-05-24 13:55:52 +10:00
parent 340370fd68
commit 5689d69bfb
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
1 changed files with 6 additions and 3 deletions

View File

@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
@ -54,12 +55,12 @@ namespace BizHawk.Emulation.Common
var filename = Path.Combine(path, line); var filename = Path.Combine(path, line);
if (File.Exists(filename)) if (File.Exists(filename))
{ {
Console.WriteLine("loading external game database {0}", line); Debug.WriteLine("loading external game database {0}", line);
LoadDatabase(filename); LoadDatabase(filename);
} }
else else
{ {
Console.WriteLine("BENIGN: missing external game database {0}", line); Debug.WriteLine("BENIGN: missing external game database {0}", line);
} }
} }
@ -146,16 +147,18 @@ namespace BizHawk.Emulation.Common
ForcedCore = items.Length >= 8 ? items[7].ToLowerInvariant() : "" ForcedCore = items.Length >= 8 ? items[7].ToLowerInvariant() : ""
}; };
#if DEBUG
if (DB.ContainsKey(game.Hash)) if (DB.ContainsKey(game.Hash))
{ {
Console.WriteLine("gamedb: Multiple hash entries {0}, duplicate detected on \"{1}\" and \"{2}\"", game.Hash, game.Name, DB[game.Hash].Name); Console.WriteLine("gamedb: Multiple hash entries {0}, duplicate detected on \"{1}\" and \"{2}\"", game.Hash, game.Name, DB[game.Hash].Name);
} }
#endif
DB[game.Hash] = game; DB[game.Hash] = game;
} }
catch catch
{ {
Console.WriteLine($"Error parsing database entry: {line}"); Debug.WriteLine($"Error parsing database entry: {line}");
} }
} }
} }