Project

General

Profile

Actions

Bug #17508

closed

Log-file related error messages are printed to stdout

Added by Doug Penner over 7 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Hammer core
Target version:
Difficulty:
trivial
Triaged:
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:

Description

If hammer is unable to create a log file, it prints the following messages to stdout, followed by the normal output.
No permissions to create log dir <log_folder_path>
File <log_file_path> not writeable, won't log anything to the file!

This breaks scripts really badly when using --json because it makes the output non-compliant. Error messages like this (especially non-fatal ones) should be sent to stderr instead.
Looking at hammer_cli/logger.rb (lines 57 & 72), hammer is using puts instead of stderr.puts, so this should be an easy fix.

Actions

Also available in: Atom PDF