Decompiled source of LogSpamRemover v1.0.0

LogSpamRemover.dll

Decompiled a week ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("LogSpamRemover")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LogSpamRemover")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("1e660749-d1ac-4057-8fe3-d33d467ea89f")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
[BepInPlugin("Caen.CaensLogSpamRemover", "CaensLogSpamRemover", "1.0.0")]
public class LogSpamRemover : BaseUnityPlugin
{
	internal const string ModName = "CaensLogSpamRemover";

	internal const string ModVersion = "1.0.0";

	internal const string Author = "Caen";

	public const string ModGUID = "Caen.CaensLogSpamRemover";

	private void Awake()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		Harmony val = new Harmony("com.yourname.hidelogspam");
		val.PatchAll();
	}
}
[HarmonyPatch(typeof(Debug), "Log", new Type[] { typeof(object) })]
public static class DebugLogPatch
{
	private static bool Prefix(ref object message)
	{
		string text = message?.ToString() ?? string.Empty;
		if (text.Contains("PlatformUserID"))
		{
			return false;
		}
		return true;
	}
}