Skip to content

Commit b586eee

Browse files
committed
[+] Banner, better logging
1 parent 3f27055 commit b586eee

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

mod/Core.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ public class Core : MelonMod
1818

1919
public override void OnInitializeMelon()
2020
{
21+
LoggerInstance.Msg("""
22+
/=============================\
23+
| . . . .. . |
24+
| | | _ ._.| _|| *._ ;_/ |
25+
| |/\|(_)[ |(_]|___|[ )| \ |
26+
\=============================/
27+
| Version 1.0.0 |
28+
| Made with <3 by Aza |
29+
\=========================/
30+
""");
31+
2132
// Load config
2233
LoggerInstance.Msg("Loading config...");
2334
Config = TomletMain.To<Config>(File.ReadAllText("WorldLink.toml"));

mod/WorldLink/FutariTypes.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ public static class Log
129129
public const string BRIGHT_CYAN = "";
130130
public const string BRIGHT_WHITE = "";
131131
public const string RESET = "";
132+
public const string PREFIX = "[FUTARI] ";
132133
#else
133134
// Text colors
134135
public const string BLACK = "\u001b[30m";
@@ -152,6 +153,7 @@ public static class Log
152153

153154
// Reset
154155
public const string RESET = "\u001b[0m";
156+
public const string PREFIX = "";
155157
#endif
156158

157159
// Remove all non-printable characters
@@ -162,15 +164,15 @@ public static void Error(string msg)
162164
{
163165
lock (_lock)
164166
{
165-
MelonLogger.Error($"[FUTARI] {RED}ERROR {RESET}{msg.Norm()}{RESET}");
167+
MelonLogger.Error($"{PREFIX}{RED}ERROR {RESET}{msg.Norm()}{RESET}");
166168
}
167169
}
168170

169171
public static void Warn(string msg)
170172
{
171173
lock (_lock)
172174
{
173-
MelonLogger.Warning($"[FUTARI] {YELLOW}WARN {RESET}{msg.Norm()}{RESET}");
175+
MelonLogger.Warning($"{PREFIX}{YELLOW}WARN {RESET}{msg.Norm()}{RESET}");
174176
}
175177
}
176178

@@ -179,7 +181,7 @@ public static void Debug(string msg)
179181
if (!Futari.Debug) return;
180182
lock (_lock)
181183
{
182-
MelonLogger.Msg($"[FUTARI] {CYAN}DEBUG {RESET}{msg.Norm()}{RESET}");
184+
MelonLogger.Msg($"{PREFIX}{CYAN}DEBUG {RESET}{msg.Norm()}{RESET}");
183185
}
184186
}
185187

@@ -189,7 +191,7 @@ public static void Info(string msg)
189191
{
190192
if (msg.StartsWith("A001")) msg = MAGENTA + msg;
191193
if (msg.StartsWith("A002")) msg = CYAN + msg;
192-
MelonLogger.Msg($"[FUTARI] {GREEN}INFO {RESET}{msg.Norm()}{RESET}");
194+
MelonLogger.Msg($"{PREFIX}{GREEN}INFO {RESET}{msg.Norm()}{RESET}");
193195
}
194196
}
195197
}

0 commit comments

Comments
 (0)