Module: DevSuite::Utils::Logger::Formatter
- Defined in:
- lib/dev_suite/utils/logger/formatter.rb
Constant Summary collapse
- LOG_DETAILS =
{ none: { prefix: "", color: :white }, info: { prefix: "[INFO]", color: :green }, warn: { prefix: "[WARNING]", color: :yellow }, error: { prefix: "[ERROR]", color: :red }, debug: { prefix: "[DEBUG]", color: :blue }, }.freeze
Class Method Summary collapse
Class Method Details
.format(message, options = {}) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/dev_suite/utils/logger/formatter.rb', line 16 def format(, = {}) return "" if .nil? || .strip.empty? details = fetch_log_details([:level]) prefix = [:prefix] || details[:prefix] color = [:color] || details[:color] emoji_icon = Emoji.resolve([:emoji]) = (prefix, emoji_icon, ) Utils::Color.colorize(, color: color) end |