Class: Aircana::HumanLogger

Inherits:
Object
  • Object
show all
Defined in:
lib/aircana/human_logger.rb

Constant Summary collapse

EMOJIS =

Emoji mappings for different message types

{
  # Core status indicators
  success: "✅",
  error: "❌",
  warning: "⚠️",
  info: "ℹ️",

  # Context-specific emojis
  file: "📁",
  files: "📁",
  agent: "🤖",
  network: "🌐",
  page: "📄",
  pages: "📄",
  search: "🔍",
  generation: "⚙️",

  # Action emojis
  created: "📝",
  stored: "💾",
  refresh: "🔄",
  install: "📦",
  found: "🔍",
  added: "➕",
  removed: "➖"
}.freeze
COLORS =

Color codes for terminal output

{
  success: "\e[32m", # Green
  error: "\e[31m",   # Red
  warning: "\e[33m", # Yellow
  info: "\e[36m",    # Cyan
  reset: "\e[0m"     # Reset
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(output = $stdout) ⇒ HumanLogger

Returns a new instance of HumanLogger.



42
43
44
# File 'lib/aircana/human_logger.rb', line 42

def initialize(output = $stdout)
  @output = output
end

Instance Method Details

#error(message) ⇒ Object



50
51
52
# File 'lib/aircana/human_logger.rb', line 50

def error(message)
  log_with_emoji_and_color(:error, message)
end

#info(message) ⇒ Object



58
59
60
# File 'lib/aircana/human_logger.rb', line 58

def info(message)
  log_with_emoji_and_color(:info, message)
end

#success(message) ⇒ Object



46
47
48
# File 'lib/aircana/human_logger.rb', line 46

def success(message)
  log_with_emoji_and_color(:success, message)
end

#warn(message) ⇒ Object



54
55
56
# File 'lib/aircana/human_logger.rb', line 54

def warn(message)
  log_with_emoji_and_color(:warning, message)
end