forked from ServiceStackV3/ServiceStack.Contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLogManager.cs
More file actions
52 lines (48 loc) · 1.48 KB
/
LogManager.cs
File metadata and controls
52 lines (48 loc) · 1.48 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System;
using ServiceStack.Logging.Support.Logging;
namespace ServiceStack.Logging
{
/// <summary>
/// Logging API for this library. You can inject your own implementation otherwise
/// will use the DebugLogFactory to write to System.Diagnostics.Debug
/// </summary>
public class LogManager
{
private static ILogFactory logFactory;
/// <summary>
/// Gets or sets the log factory.
/// Use this to override the factory that is used to create loggers
/// </summary>
/// <value>The log factory.</value>
public static ILogFactory LogFactory
{
get
{
if (logFactory == null)
{
return new DebugLogFactory();
}
return logFactory;
}
set { logFactory = value; }
}
/// <summary>
/// Gets the logger.
/// </summary>
/// <param name="type">The type.</param>
/// <returns></returns>
public static ILog GetLogger(Type type)
{
return LogFactory.GetLogger(type);
}
/// <summary>
/// Gets the logger.
/// </summary>
/// <param name="typeName">Name of the type.</param>
/// <returns></returns>
public static ILog GetLogger(string typeName)
{
return LogFactory.GetLogger(typeName);
}
}
}