Module: Canon::Rebaseliner::Logger

Defined in:
lib/canon/rebaseliner/logger.rb

Overview

Single-line stderr writes prefixed with [canon:rebaseline]. CI- and grep-friendly. No color, no buffering.

Constant Summary collapse

PREFIX =
"[canon:rebaseline]"

Class Method Summary collapse

Class Method Details

.log(status, spec_path:, line:, detail: nil) ⇒ void

This method returns an undefined value.

Parameters:

  • status (Symbol)

    :rewritten / :skipped_* / :error

  • spec_path (String)
  • line (Integer)
  • detail (String, nil) (defaults to: nil)

    short reason or contextual note



17
18
19
20
21
# File 'lib/canon/rebaseliner/logger.rb', line 17

def log(status, spec_path:, line:, detail: nil)
  location = "#{spec_path}:#{line}"
  suffix = detail ? " (#{detail})" : ""
  warn "#{PREFIX} #{status} #{location}#{suffix}"
end