Skip to content

Sharpmake writes error logs to stdout instead of stderr #459

@MrBinaryCats

Description

@MrBinaryCats

Summary

Sharpmake appears to emit error-level output via Console.Write(...) (stdout) instead of Console.Error (stderr).
In CI systems (e.g., TeamCity), this causes [ERROR] lines to be displayed as normal logs, even when the process exits non-zero.

Why this matters

Many CI runners classify/format logs by stream:

  • stdout -> normal log
  • stderr -> error log

When Sharpmake writes errors to stdout, CI cannot reliably highlight or classify error lines as errors.

Observed behavior

Example output includes error text like:

  • [ERROR]
  • Error:
  • exception details

But these lines are emitted on stdout, not stderr.

Expected behavior

Error and warning-level logs should be written to stderr (or at least provide an option to do so), while informational logs remain on stdout.

Suggested fix

When severity is error (and possibly warning), write to Console.Error instead of Console.Write / Console.Out.

For example, in logging flow (ErrorWrite -> LogWrite):

  • if severity == error => Console.Error.Write(...)
  • else => Console.Write(...)

Environment

  • Sharpmake.Application.exe (custom/forked usage in CI)
  • TeamCity Command Line runner
  • Problem reproducible when process exits with error: CI sees failure code, but log lines remain unclassified as normal output

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