Module: DevSuite::Utils::Logger

Defined in:
lib/dev_suite/utils/logger.rb,
lib/dev_suite/utils/logger/base.rb,
lib/dev_suite/utils/logger/emoji.rb,
lib/dev_suite/utils/logger/errors.rb,
lib/dev_suite/utils/logger/logger.rb,
lib/dev_suite/utils/logger/formatter.rb

Defined Under Namespace

Modules: Emoji, Formatter Classes: Base, InvalidLogLevelError

Class Method Summary collapse

Class Method Details

.log(message, level: :none, emoji: nil, prefix: nil, color: nil) ⇒ Object

Logs a message using the global logger instance

Parameters:

  • message (String)

    The message to log.

  • level (Symbol) (defaults to: :none)

    The log level (:none, :info, :warn, :error, :debug).

  • emoji (String, Symbol, nil) (defaults to: nil)

    Optional emoji to prepend to the message.

  • prefix (String, nil) (defaults to: nil)

    Custom prefix for the message.

  • color (Symbol, nil) (defaults to: nil)

    Custom color for the message.



23
24
25
# File 'lib/dev_suite/utils/logger/logger.rb', line 23

def log(message, level: :none, emoji: nil, prefix: nil, color: nil)
  logger.log(message, level: level, emoji: emoji, prefix: prefix, color: color)
end

.loggerBase

Provides access to the global logger instance

Returns:

  • (Base)

    the global logger instance



12
13
14
# File 'lib/dev_suite/utils/logger/logger.rb', line 12

def logger
  @logger ||= Base.new
end