-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathServiceStackLoggingBackend.cs
More file actions
32 lines (27 loc) · 1.03 KB
/
ServiceStackLoggingBackend.cs
File metadata and controls
32 lines (27 loc) · 1.03 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
using PostSharp.Patterns.Diagnostics;
using PostSharp.Patterns.Diagnostics.Backends;
using PostSharp.Patterns.Diagnostics.RecordBuilders;
using System;
namespace PostSharp.Samples.Logging.CustomBackend.ServiceStack
{
public class ServiceStackLoggingBackend : TextLoggingBackend
{
public new ServiceStackLoggingBackendOptions Options { get; } = new ServiceStackLoggingBackendOptions();
protected override LoggingTypeSource CreateTypeSourceBySourceName(LoggingNamespaceSource parent, string sourceName)
{
return new ServiceStackLoggingTypeSource(parent, sourceName, null);
}
protected override LoggingTypeSource CreateTypeSource(LoggingNamespaceSource parent, Type type)
{
return new ServiceStackLoggingTypeSource(parent, null, type);
}
public override LogRecordBuilder CreateRecordBuilder()
{
return new ServiceStackLogRecordBuilder(this);
}
protected override TextLoggingBackendOptions GetTextBackendOptions()
{
return Options;
}
}
}