Closed Smaug123 closed 5 months ago
Mmh, I can't reproduce this one with:
type MyEx () =
inherit System.Exception()
let testlog1 () =
use factory = LoggerFactory.Create(fun b -> b.AddConsole() |> ignore)
let log: ILogger = factory.CreateLogger("Program")
let e: MyEx = MyEx()
log.LogWarning(e, "Error: {Something}", 3)
Or do you mean it should ignore missing args if the first arg inherits from exception, like:
log.LogWarning(e, "Error: {Something}") // don't warn here
Oh sorry, I'll try and reproduce it internally and get an exact repro out to you.
Cool, thanks!
@dawedawe sample to reproduce should be:
namespace Blah
open Microsoft.Extensions.Logging
module Program =
[<EntryPoint>]
let main argv =
let log : ILogger = failwith "TODO"
try
failwith "no"
with e ->
log.LogError (e, "Failed to look up: {s_Group}", 3)
raise e
0
I observed today in GR that
GRA-LOGTEMPLMISSVALS-001
incorrectly fired on the following:Since the first argument inherits from
Exception
, it should be ignored for the purposes of this analyzer.