-
Notifications
You must be signed in to change notification settings - Fork 118
/
Copy pathLogManager.cs
30 lines (27 loc) · 1.01 KB
/
LogManager.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
30
using System;
namespace WPFMediaKit
{
/// <summary>
/// Log manager for the WPF-MediaKit. Set <see cref="LoggerFunc"/> to change the logging.
/// </summary>
public static class LogManager
{
/// <summary>
/// Main func to get an <see cref="ILog"/> for the provided logger name. Default is set to <see cref="DebugTraceLog"/>.
/// <para>
/// May be changed by the user code. Set to <see cref="NullLog.Instance"/> to switch off the logging.
/// </para>
/// </summary>
public static Func<string, ILog> LoggerFunc = name => new DebugTraceLog(name);
/// <summary>
/// Returns an <see cref="ILog"/> for the provided logger name.
/// </summary>
public static ILog GetLogger(string name)
=> LoggerFunc(name);
/// <summary>
/// Retuns an <see cref="ILog"/> for the provided logger name.
/// </summary>
public static ILog GetLogger(Type type)
=> LoggerFunc(type.FullName);
}
}