forked from IvanMurzak/Unity-MCP
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUnityLoggerFactory.cs
More file actions
37 lines (34 loc) · 1.55 KB
/
UnityLoggerFactory.cs
File metadata and controls
37 lines (34 loc) · 1.55 KB
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
30
31
32
33
34
35
36
37
/*
┌──────────────────────────────────────────────────────────────────┐
│ Author: Ivan Murzak (https://github.com/IvanMurzak) │
│ Repository: GitHub (https://github.com/IvanMurzak/Unity-MCP) │
│ Copyright (c) 2025 Ivan Murzak │
│ Licensed under the Apache License, Version 2.0. │
│ See the LICENSE file in the project root for more information. │
└──────────────────────────────────────────────────────────────────┘
*/
#nullable enable
using Microsoft.Extensions.Logging;
namespace com.IvanMurzak.Unity.MCP.Utils
{
public static class UnityLoggerFactory
{
private static ILoggerFactory? _loggerFactory;
public static ILoggerFactory LoggerFactory
{
get
{
if (_loggerFactory == null)
{
_loggerFactory = Microsoft.Extensions.Logging.LoggerFactory.Create(builder =>
{
builder.ClearProviders();
builder.AddProvider(new UnityLoggerProvider());
builder.SetMinimumLevel(Microsoft.Extensions.Logging.LogLevel.Trace);
});
}
return _loggerFactory;
}
}
}
}