-
Notifications
You must be signed in to change notification settings - Fork 58
/
Program.cs
27 lines (23 loc) · 914 Bytes
/
Program.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
using Common.Logging;
using Common.Logging.Simple;
using PostSharp.Patterns.Diagnostics;
using PostSharp.Patterns.Diagnostics.Backends.CommonLogging;
using PostSharp.Samples.Logging.BusinessLogic;
// Adds logging to all methods of this project.
[assembly: Log]
namespace PostSharp.Samples.Logging.CommonLogging
{
[Log(AttributeExclude = true)] // Removes logging from the Program class itself.
internal class Program
{
private static void Main(string[] args)
{
// Configure Common.Logging to direct outputs to the system console.
LogManager.Adapter = new ConsoleOutLoggerFactoryAdapter();
// Configure PostSharp Logging to direct outputs to Common.Logging.
LoggingServices.DefaultBackend = new CommonLoggingLoggingBackend();
// Simulate some business logic.
QueueProcessor.ProcessQueue(@".\Private$\SyncRequestQueue");
}
}
}