-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathILogAdapter.cs
More file actions
49 lines (48 loc) · 1.58 KB
/
ILogAdapter.cs
File metadata and controls
49 lines (48 loc) · 1.58 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
/* ===============================================
* 功能描述:AspNetCore.FileLog.ILoggerWriter
* 创 建 者:WeiGe
* 创建日期:1/3/2019 2:58:09 PM
* ===============================================*/
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Threading.Tasks;
namespace AspNetCore.FileLog
{
/// <summary>
///
/// </summary>
public abstract class LogAdapter
{
/// <summary>
///
/// </summary>
protected abstract LogType LogType { get; }
/// <summary>
///
/// </summary>
/// <param name="category"></param>
/// <param name="eventName"></param>
/// <param name="logLevel"></param>
/// <param name="type"></param>
/// <param name="stackFrames"></param>
/// <param name="message"></param>
/// <param name="exception"></param>
/// <param name="context"></param>
public abstract void Log(string category, string eventName, LogLevel logLevel, LogType type,
string message, StackFrame[] stackFrames, Exception exception, HttpContext context);
/// <summary>
///
/// </summary>
/// <param name="current"></param>
/// <param name="rule"></param>
/// <returns></returns>
public virtual bool IsEnabled(LogType current, LogType rule)
{
return this.LogType.HasFlag(current) && (rule == LogType.All || rule.HasFlag(current));
}
}
}