-
Notifications
You must be signed in to change notification settings - Fork 96
/
ModLogger.cs
29 lines (24 loc) · 840 Bytes
/
ModLogger.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using UnityEngine;
namespace ModuleManager.Logging
{
public class ModLogger : IBasicLogger
{
private string prefix;
private ILogger logger;
public ModLogger(string prefix, ILogger logger)
{
this.prefix = "[" + prefix + "] ";
this.logger = logger;
}
public void Log(LogType logType, string message) => logger.Log(logType, prefix + message);
public void Info(string message) => Log(LogType.Log, message);
public void Warning(string message) => Log(LogType.Warning, message);
public void Error(string message) => Log(LogType.Error, message);
public void Exception(string message, Exception exception)
{
Error(message);
logger.LogException(exception);
}
}
}