forked from sarbian/ModuleManager
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModLogger.cs
More file actions
21 lines (18 loc) · 721 Bytes
/
Copy pathModLogger.cs
File metadata and controls
21 lines (18 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
using System;
using UnityEngine;
namespace ModuleManager.Logging
{
public class ModLogger : IBasicLogger
{
private string prefix;
private IBasicLogger logger;
public ModLogger(string prefix, IBasicLogger logger)
{
if (string.IsNullOrEmpty(prefix)) throw new ArgumentNullException(nameof(prefix));
this.prefix = "[" + prefix + "] ";
this.logger = logger ?? throw new ArgumentNullException(nameof(logger));
}
public void Log(LogType logType, string message) => logger.Log(logType, prefix + message);
public void Exception(string message, Exception exception) => logger.Exception(prefix + message, exception);
}
}