Skip to content

Commit 1a40a23

Browse files
committed
Implemented base HEC logger class
#5
1 parent cd9f096 commit 1a40a23

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
using System;
2+
using System.Net.Http;
3+
using Microsoft.Extensions.Logging;
4+
5+
namespace Splunk.Loggers
6+
{
7+
public abstract class HECBaseLogger
8+
{
9+
protected readonly ILoggerFormatter loggerFormatter;
10+
protected readonly BatchManager batchManager;
11+
12+
readonly string categoryName;
13+
readonly LogLevel threshold;
14+
readonly HttpClient httpClient;
15+
16+
public HECBaseLogger(string categoryName, LogLevel threshold, HttpClient httpClient, BatchManager batchManager, ILoggerFormatter loggerFormatter)
17+
{
18+
this.categoryName = categoryName;
19+
this.threshold = threshold;
20+
this.httpClient = httpClient;
21+
this.batchManager = batchManager;
22+
this.loggerFormatter = loggerFormatter;
23+
}
24+
25+
public bool IsEnabled(LogLevel logLevel)
26+
{
27+
return (int)logLevel >= (int)threshold;
28+
}
29+
30+
public IDisposable BeginScope<T>(T state)
31+
{
32+
return null;
33+
}
34+
}
35+
}

0 commit comments

Comments
 (0)