forked from Shardstone/trail-into-darkness
24 lines
702 B
C#
24 lines
702 B
C#
using System.Runtime.CompilerServices;
|
|
|
|
namespace Jovian.InGameLogging {
|
|
public readonly struct InGameLogger {
|
|
readonly IGameLogStore store;
|
|
readonly LogChannel channel;
|
|
|
|
public InGameLogger(IGameLogStore store, LogChannel channel) {
|
|
this.store = store;
|
|
this.channel = channel;
|
|
}
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public void Log(string message) {
|
|
store.Add(channel, message);
|
|
}
|
|
|
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
public void Log(string message, string hexColor) {
|
|
store.Add(channel, $"<color={hexColor}>{message}</color>");
|
|
}
|
|
}
|
|
}
|