Skip to content

Commit

Permalink
Fixed Build Error
Browse files Browse the repository at this point in the history
  • Loading branch information
SkyTech6 committed Dec 4, 2024
1 parent 20d5f10 commit f1bfa2a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
`1.0.1`
`1.0.2`
- Removed Bloodstone Dependency
- Added Optional CrimsonLog Support

Expand Down
17 changes: 10 additions & 7 deletions Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using CrimsonChatFilter.Structs;
using HarmonyLib;
using BepInEx.Logging;
using Logger = CrimsonLog.Systems.Logger;
using System;

namespace CrimsonChatFilter;

Expand Down Expand Up @@ -42,14 +42,17 @@ public override void Load()

public static void AddLog(string message, bool console = false)
{
if (LogLoaded && CrimsonLog.Plugin.LogInstance != null && !console)
if (LogLoaded && !console)
{
Logger.Record("Chat/Filter", "filter", message);
}
else
{
LogInstance.LogInfo(message);
var loggerType = Type.GetType("CrimsonLog.Systems.Logger, CrimsonLog");
if (loggerType != null)
{
loggerType.GetMethod("Record").Invoke(null, new object[] { "Chat/Filter", "filter", message });
return;
}
}

LogInstance.LogInfo(message);
}

public override bool Unload()
Expand Down

0 comments on commit f1bfa2a

Please sign in to comment.