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

Version Path
plutonium-0.15.22 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.15.21 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.15.20 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.15.19 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.15.18 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.15.17 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.15.16 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.15.15 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.15.14 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.15.13 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.15.12 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.15.11 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.15.10 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.15.9 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.15.8 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.15.7 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.15.6 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.15.5 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.15.4 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.15.3 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb