Skip to content

Commit 8ea559b

Browse files
committed
clean up
1 parent ba779c1 commit 8ea559b

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/MyOpenTelemetryApi.Api/Telemetry/FileExporter.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace MyOpenTelemetryApi.Api.Telemetry;
88
public class FileLogExporter : BaseExporter<LogRecord>
99
{
1010
private readonly string _filePath;
11-
private readonly object _lockObject = new();
11+
private readonly Lock _lockObject = new();
1212
private readonly JsonSerializerOptions _jsonOptions;
1313

1414
public FileLogExporter(string filePath)
@@ -40,14 +40,14 @@ public override ExportResult Export(in Batch<LogRecord> batch)
4040
{
4141
var logEntry = new
4242
{
43-
Timestamp = logRecord.Timestamp,
43+
logRecord.Timestamp,
4444
TraceId = logRecord.TraceId.ToString(),
4545
SpanId = logRecord.SpanId.ToString(),
4646
TraceFlags = logRecord.TraceFlags.ToString(),
47-
CategoryName = logRecord.CategoryName,
47+
logRecord.CategoryName,
4848
LogLevel = logRecord.LogLevel.ToString(),
49-
FormattedMessage = logRecord.FormattedMessage,
50-
Body = logRecord.Body,
49+
logRecord.FormattedMessage,
50+
logRecord.Body,
5151
ScopeValues = ExtractScopeValues(logRecord),
5252
Exception = logRecord.Exception?.ToString(),
5353
Attributes = ExtractAttributes(logRecord)
@@ -67,7 +67,7 @@ public override ExportResult Export(in Batch<LogRecord> batch)
6767
}
6868
}
6969

70-
private List<object> ExtractScopeValues(LogRecord logRecord)
70+
private static List<object> ExtractScopeValues(LogRecord logRecord)
7171
{
7272
var scopes = new List<object>();
7373

@@ -82,7 +82,7 @@ private List<object> ExtractScopeValues(LogRecord logRecord)
8282
return scopes;
8383
}
8484

85-
private Dictionary<string, object?> ExtractAttributes(LogRecord logRecord)
85+
private static Dictionary<string, object?> ExtractAttributes(LogRecord logRecord)
8686
{
8787
var attributes = new Dictionary<string, object?>();
8888

src/MyOpenTelemetryApi.Api/Telemetry/TelemetryExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public static TracerProviderBuilder AddFileExporter(
2222
var enabled = configuration.GetValue<bool>("OpenTelemetry:Exporter:File:Enabled");
2323
if (enabled)
2424
{
25-
var tracePath = configuration.GetValue<string>("OpenTelemetry:Exporter:File:TracePath")
25+
_ = configuration.GetValue<string>("OpenTelemetry:Exporter:File:TracePath")
2626
?? "logs/otel-traces.json";
2727
// For traces, we'd implement a similar FileTraceExporter
2828
// For now, we'll use console exporter as file trace export is complex

src/MyOpenTelemetryApi.Application/Services/ContactService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ public async Task<List<ContactSummaryDto>> GetByTagAsync(Guid tagId)
318318
return results;
319319
}
320320

321-
private ContactDto MapToDto(Contact contact)
321+
private static ContactDto MapToDto(Contact contact)
322322
{
323323
return new ContactDto
324324
{

src/MyOpenTelemetryApi.Application/Services/GroupService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public async Task<bool> DeleteAsync(Guid id)
7474
return true;
7575
}
7676

77-
private GroupDto MapToDto(Group group)
77+
private static GroupDto MapToDto(Group group)
7878
{
7979
return new GroupDto
8080
{

0 commit comments

Comments
 (0)