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 almost 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 #1

Updated by The Foreman Bot over 7 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Tomáš Strachota
  • Pull request https://github.com/theforeman/hammer-cli/pull/228 added
Actions #2

Updated by Tomáš Strachota over 7 years ago

  • Assignee deleted (Tomáš Strachota)
  • Target version set to 1.10.1
Actions #3

Updated by Tomáš Strachota over 7 years ago

  • Assignee set to Tomáš Strachota
Actions #4

Updated by Anonymous over 7 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions #5

Updated by Tomáš Strachota about 7 years ago

  • translation missing: en.field_release set to 235
Actions

Also available in: Atom PDF