Vixen
dd8b0a81
csharp
public sealed class DiagnosticWriter

Writes what a command found, in the form its reader can use.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

Two readers, one set of facts. A person wants the project-relative path and an aligned column they can skim; MSBuild wants an absolute path, a code, and the exact word error or warning — get that wrong and the line is prose in a log rather than an entry in an error list that can be clicked.

The path is absolute in the MSBuild form. A relative one is resolved against whatever directory the build happens to be running in, which is not the project's, so the IDE opens nothing.

⚠ A third word, advisory, for a run whose verdict is provisional. Only error and warning make an MSBuild diagnostic, so writing anything else keeps the line prose — and this deliberately is not "print less": the code and the absolute path stay on it, so the same search finds it and a person reading the log learns what the pass could not resolve. What it stops is the line reaching the error list and the CI summary, which is where a reader is entitled to assume that everything listed is worth acting on. The damage a provisional warning does is never its own; it is that it makes a real one indistinguishable, and a build whose every clean run carries two VX1001s teaches its readers to skip VX1001.

Fields and properties (1)

Methods (5)

  • public DiagnosticWriter(TextWriter output, DiagnosticFormat format, string? root = null, bool advisory = false)

    Writes what a command found, in the form its reader can use.

  • public void Asset(ImportSeverity severity, string path, string code, string message)

    Says something about one asset.

  • public void Project(ImportSeverity severity, string code, string message)

    Says something about the project rather than about one asset in it.

  • public void Line(string message)

    Says something that is neither, like a summary line.

  • public static ImportSeverity SeverityOf(AssetIssueKind kind)

    The severity an asset-database issue carries.

Used by (5)

  • AddressRunnerVixen.Cli
  • ContentBuildRunnerVixen.Cli
  • ImportRunnerVixen.Cli
  • ShaderBuildRunnerVixen.Cli
  • VixenCommandVixen.Cli