Skip to content

Commit 271a20e

Browse files
committed
refactor: Change announce print to be prettier / include config options
1 parent 99b84e9 commit 271a20e

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

src/UnityDebuggerAssistant/UDAPlugin.cs

+22-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
using BepInEx;
1+
using BepInEx;
22
using BepInEx.Logging;
33
using HarmonyLib;
44
using MonoMod.RuntimeDetour;
5+
using System.Linq;
6+
using System.Text;
57
using UnityDebuggerAssistant.Components;
68
using UnityDebuggerAssistant.Filtering;
79
using UnityDebuggerAssistant.Patches;
@@ -40,24 +42,34 @@ We assign it here
4042

4143
/************************************************************
4244
Output big warning message here to help people understand
43-
the actual use of this plugin
45+
the actual use of this plugin, also log configuration
4446
************************************************************/
4547

46-
Log.LogMessage("""
48+
StringBuilder sb = new("""
49+
4750
4851
>------------------------------------------------------------------------<
4952
Unity Debugger assistant is loaded and receiving exceptions!
5053
5154
Note: That UDA will catch ALL exceptions, even harmless ones
5255
Please ONLY report logs to modders if you have an issue with their mod
53-
>------------------------------------------------------------------------<
54-
""");
5556
56-
//Log configuration here
57-
Log.LogInfo($"Using per/e whitelist: {UDASettings.EnableWhitelistPerException.Value}");
58-
Log.LogInfo($"Using per/f whitelist: {UDASettings.EnableWhitelistPerFrame.Value}");
59-
Log.LogInfo($"Using per/e blacklist: {UDASettings.EnableBlacklistPerException.Value}");
60-
Log.LogInfo($"Using per/f blacklist: {UDASettings.EnableBlacklistPerFrame.Value}");
57+
Config:
58+
59+
""");
60+
sb.Append(" Using Per-Exception Whitelist: ");
61+
sb.AppendLine(UDASettings.EnableWhitelistPerException.Value.ToString());
62+
sb.Append(" Using Per-Exception Blacklist: ");
63+
sb.AppendLine(UDASettings.EnableBlacklistPerException.Value.ToString());
64+
sb.Append(" Using Per-Frame Whitelist: ");
65+
sb.AppendLine(UDASettings.EnableWhitelistPerFrame.Value.ToString());
66+
sb.Append(" Using Per-Frame Blacklist: ");
67+
sb.AppendLine(UDASettings.EnableBlacklistPerFrame.Value.ToString());
68+
sb.Append(" Total Filters: ");
69+
sb.AppendLine((UDABlacklist.ExceptionBlackList.Count() + UDABlacklist.FrameBlackList.Count()).ToString());
70+
sb.AppendLine(">------------------------------------------------------------------------<");
71+
72+
Log.LogMessage(sb);
6173

6274
// Add listeners
6375
ILHook.OnDetour += UDAPatchListener.ListenForPatch;

0 commit comments

Comments
 (0)