Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 566a7d2

Browse files
committed
Suppress CA1004 warning from LogManager
1 parent 0405986 commit 566a7d2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/GitHub.Logging/Logging/LogManager.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.IO;
3+
using System.Diagnostics.CodeAnalysis;
34
using GitHub.Info;
45
using Serilog;
56
using Serilog.Core;
@@ -29,10 +30,8 @@ static Logger CreateLogger()
2930

3031
static Lazy<Logger> Logger { get; } = new Lazy<Logger>(CreateLogger);
3132

32-
//Violates CA1004 - Generic methods should provide type parameter
33-
#pragma warning disable CA1004
33+
[SuppressMessage("Microsoft.Design", "CA1004:GenericMethodsShouldProvideTypeParameter")]
3434
public static ILogger ForContext<T>() => ForContext(typeof(T));
35-
#pragma warning restore CA1004
3635

3736
public static ILogger ForContext(Type type) => Logger.Value.ForContext(type).ForContext("ShortSourceContext", type.Name);
3837
}

0 commit comments

Comments
 (0)