Skip to content

Framework log lines written to stdout pollute model method output #664

@bixu

Description

@bixu

Description

When running swamp model method run, framework-level log lines are written to stdout and intermixed with the model's own stdout output. This makes it impossible to pipe or redirect clean output from a model method without garbage lines at the top of the file.

Steps to Reproduce

  1. Create a model that writes formatted output to stdout (e.g. markdown tables)
  2. Run: swamp model method run my-model myMethod > report.md
  3. Open report.md

Expected Behavior

report.md should contain only the model's stdout output — clean, parseable content.

Actual Behavior

The file contains 3+ framework log lines before the model output:

Found model "my-model" ("@org/my-model")
Evaluating expressions
Executing method "myMethod"

These are framework-level info logs that should be written to stderr, not stdout, so that stdout remains clean for programmatic use.

Workaround

The -q / --quiet flag suppresses these lines:

swamp model method run my-model myMethod -q > report.md

However, the default behavior should respect the Unix convention of keeping stdout for data and stderr for diagnostics.

Suggested Fix

The model method run command's framework-level log output should be written to stderr instead of stdout. This affects the log rendering layer — the structured log entries themselves are fine, they just need to target the correct output stream.

Metadata

Metadata

Assignees

Labels

featureFeature request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions