Sha256: 4be16bf854e8d7eed8827f71350d7c104b6067b51a13fe3970fc4f46fce56915

Contents?: true

Size: 724 Bytes

Versions: 24

Compression:

Stored size: 724 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}\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

24 entries across 24 versions & 1 rubygems

Version Path
plutonium-0.14.1 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.14.0 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.13.3 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.13.2 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.13.1 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.13.0 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.12.14 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.12.13 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.12.12 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.12.11 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.12.10 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.12.9 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.12.8 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.12.7 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.12.5 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.12.4 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.12.3 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.12.2 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.12.1 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb
plutonium-0.12.0 lib/generators/pu/lib/plutonium_generators/concerns/logger.rb