Skip to content

Commit b112fe0

Browse files
committed
Implemented module logging
1 parent 2abd6f5 commit b112fe0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

TLibrary/Models/Plugin/TLogger.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.IO;
33
using System.Text.RegularExpressions;
4+
using Tavstal.TLibrary.Extensions;
45

56
namespace Tavstal.TLibrary.Models.Plugin
67
{
@@ -181,7 +182,11 @@ public void SetDebugMode(bool isActive)
181182
/// <param name="prefix"></param>
182183
public void LogRich(object message, string prefix = "&a[INFO] >&f")
183184
{
184-
string text = $"&b[{_pluginName}] {prefix} {message}";
185+
string text;
186+
if (_moduleName.IsNullOrEmpty())
187+
text = $"&b[{_pluginName}] {prefix} {message}";
188+
else
189+
text = $"&b[{_pluginName}] [{_moduleName}] {prefix} {message}";
185190
try
186191
{
187192
ConsoleColor oldColor = Console.ForegroundColor;

0 commit comments

Comments
 (0)