forked from Sustainsys/Saml2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOwinLoggerAdapter.cs
54 lines (49 loc) · 1.45 KB
/
OwinLoggerAdapter.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using Microsoft.Owin.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Sustainsys.Saml2.Owin
{
/// <summary>
/// Adapter for Saml2 logging around owin logging system.
/// </summary>
public class OwinLoggerAdapter : ILoggerAdapter
{
ILogger logger;
/// <summary>
/// Ctor
/// </summary>
/// <param name="logger">Owin logger to wrap</param>
public OwinLoggerAdapter(ILogger logger)
{
this.logger = logger;
}
/// <summary>
/// Write an error message and include an exception
/// </summary>
/// <param name="message">Message to write</param>
/// <param name="ex">Exception with details</param>
public void WriteError(string message, Exception ex)
{
logger.WriteError(message, ex);
}
/// <summary>
/// Write an informational message.
/// </summary>
/// <param name="message">Message to write.</param>
public void WriteInformation(string message)
{
logger.WriteInformation(message);
}
/// <summary>
/// Write a verbose informational message.
/// </summary>
/// <param name="message">Message to write</param>
public void WriteVerbose(string message)
{
logger.WriteVerbose(message);
}
}
}