Sha256: 4a0b220efc10b63387fde6aca9c6660b93a9aa108329dc587848445cf08c5137
Contents?: true
Size: 738 Bytes
Versions: 26
Compression:
Stored size: 738 Bytes
Contents
# frozen_string_literal: true module PlutoniumGenerators module Concerns module Logger def debug(msg) say format_log(msg, :debug), :magenta end def info(msg) say format_log(msg, :info), :blue end def success(msg) say format_log(msg, :success), :green end def error(msg) say format_log(msg, :error), :red exit(1) end def exception(msg, err) error "#{msg}\n\n#{err.class}: #{err}\n#{err.backtrace.join("\n")}" end private def format_log(msg, _log_level) # indentation = ' ' * (log_level.length + 2) # "#{log_level}: #{msg}" # .lines.join(indentation) msg end end end end
Version data entries
26 entries across 26 versions & 1 rubygems