ReviewOS

stacks/clarity

Every log level writes to stderr, so successful output reads as errors

#3365
Open glennmichael123 opened this 8 days ago ·
8 days ago

What happens

Logger routes every level to stderr. In dist/index.js (0.3.33) the console branch is:

levelwritten withstream
debugconsole.errorstderr
infoconsole.warnstderr
successconsole.errorstderr
warningconsole.warnstderr
errorconsole.errorstderr
case "success":
  A = this.formatConsoleMessage({ timestamp: J, icon: W, tag: O, message: G.green(Q), level: N }),
  console.error(A)

Across the whole file: console.error x7, console.warn x2, console.log x1 (unrelated). No level reaches stdout.

Why it matters

The colouring is already right — success wraps its message in G.green(...). But the stream says error, and terminals colour stderr accordingly, so a successful line is painted red regardless. During a long deploy, every SUCCESS and INFO line looks like a failure, which is the opposite of what the level means and makes a real error impossible to spot at a glance.

It also breaks ordinary shell plumbing:

./buddy deploy --prod --yes > deploy.log   # empty: everything went to stderr
./buddy deploy --prod --yes 2>/dev/null    # silences successes along with errors

and CI log viewers that style stderr will flag a wholly successful run as error output.

Expected

debug, info and success go to stdout; warning and error stay on stderr. That is the conventional split and the one every pipe, redirect and log viewer assumes.

Seen in

@stacksjs/clarity 0.3.33, via @stacksjs/logging's Logger, during a buddy deploy --prod run where every production.SUCCESS: line rendered red.

Sign in to comment on this issue.