Skip to content

Interpolated string in log functions #49

@nojaf

Description

@nojaf

Related to https://g-research.github.io/fsharp-analyzers/analyzers/LoggingArgFuncNotFullyAppliedAnalyzer.html
Would it be interesting to also have an analyzer that detects a log call with a single interpolated string?
Instead of using the log message template.

let p = 42

// ❌
logger.Log(LogLevel.Information, $"foo %i{p}")

// ✅
logger.Log(LogLevel.Information, "foo {p}", p)

Would do you think @Smaug123?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions