Skip to content

Commit afb7cf4

Browse files
committed
fix(dream-cli): route log() and warn() to stderr
dream benchmark captures cmd_chat's stdout to measure LLM response timing. Because log() wrote to stdout, the '[dream] Sending to <model>...' info line emitted inside cmd_chat leaked into the captured response string. Appending >&2 to log() and warn() routes their informational output to stderr, which is also where Unix convention puts non-data messages. The only $(cmd_*) capture in the file (cmd_benchmark line 1174) already uses 2>/dev/null, so the log banner is now cleanly discarded before display. Minimal 2-line scope. Other helpers (success, error, log_warn) left on stdout per explicit scope decision.
1 parent d5154c3 commit afb7cf4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

dream-server/dream-cli

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ NC='\033[0m'
4242
#=============================================================================
4343
# Helpers
4444
#=============================================================================
45-
log() { echo -e "${CYAN}[dream]${NC} $1"; }
45+
log() { echo -e "${CYAN}[dream]${NC} $1" >&2; }
4646
success() { echo -e "${GREEN}${NC} $1"; }
47-
warn() { echo -e "${YELLOW}${NC} $1"; }
47+
warn() { echo -e "${YELLOW}${NC} $1" >&2; }
4848
error() { echo -e "${RED}${NC} $1"; exit 1; }
4949
log_warn() { echo -e "${YELLOW}${NC} $1"; }
5050
log_error() { echo -e "${RED}${NC} $1" >&2; }

0 commit comments

Comments
 (0)