forked from ServiceStack/ServiceStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathNullLogFactory.cs
More file actions
29 lines (25 loc) · 722 Bytes
/
NullLogFactory.cs
File metadata and controls
29 lines (25 loc) · 722 Bytes
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
using System;
namespace ServiceStack.Logging
{
/// <summary>
/// Creates a Debug Logger, that logs all messages to: System.Diagnostics.Debug
///
/// Made public so its testable
/// </summary>
public class NullLogFactory : ILogFactory
{
private readonly bool debugEnabled;
public NullLogFactory(bool debugEnabled=false)
{
this.debugEnabled = debugEnabled;
}
public ILog GetLogger(Type type)
{
return new NullDebugLogger(type) { IsDebugEnabled = debugEnabled };
}
public ILog GetLogger(string typeName)
{
return new NullDebugLogger(typeName) { IsDebugEnabled = debugEnabled };
}
}
}