Skip to content

Windows CLI outputs normal results to stderr instead of stdout #111

@mtsblogs

Description

@mtsblogs

When running the Windows amd64 binary of librespeed-cli with --simple, the normal test results (Ping, Jitter, Download rate, Upload rate) are written to stderr instead of stdout.

This causes automation tools and scripts to treat the output as an error condition.


Steps to Reproduce

  1. Download latest Windows amd64 release
  2. Run:
.\librespeed-cli.exe --simple
  1. Capture streams separately:
.\librespeed-cli.exe --simple 1>out.txt 2>err.txt

Actual Behavior

  • out.txt is empty
  • err.txt contains:
Ping: 23.91 ms        Jitter: 9.66 ms
Download rate: 353.21 Mbps
Upload rate: 74.12 Mbps

PowerShell also prefixes the output with:

error>

indicating it is received on the error stream.


Expected Behavior

Normal test results should be written to stdout.

stderr should only be used for:

  • Actual errors
  • Warnings
  • Invalid arguments
  • Connection failures
  • Exceptional conditions

Why This Matters

Many automation and monitoring systems:

  • Treat stderr as failure
  • Suppress stderr by default
  • Log stderr as error events
  • Trigger alerts based on stderr output

This makes scripting and RMM integration unnecessarily complex, requiring explicit stream redirection.


Environment

  • OS: Windows 10 / 11
  • Binary: latest windows_amd64.zip release
  • Shell: PowerShell

Suggested Fix

Ensure standard result output uses:

fmt.Println(...)

(or equivalent stdout writer)

And reserve os.Stderr for actual error conditions only.

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