Class: Makit::TraceCommands

Inherits:
Cli::Base
  • Object
show all
Defined in:
lib/makit/cli/strategy_commands.rb

Overview

Add trace commands to the main CLI

Instance Method Summary collapse

Methods inherited from Cli::Base

desc

Instance Method Details

#disableObject



139
140
141
142
# File 'lib/makit/cli/strategy_commands.rb', line 139

def disable
  ENV.delete("MAKIT_TRACE")
  puts "Enhanced tracing disabled"
end

#enableObject



131
132
133
134
135
# File 'lib/makit/cli/strategy_commands.rb', line 131

def enable
  ENV["MAKIT_TRACE"] = "true"
  puts "Enhanced tracing enabled"
  puts "Run 'rake --trace' to see enhanced output"
end

#testObject



146
147
148
149
150
# File 'lib/makit/cli/strategy_commands.rb', line 146

def test
  puts "Testing trace functionality..."
  puts "Run: rake --trace"
  puts "You should see [MAKIT] prefixed trace output for makit-related tasks"
end

#traceObject



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/makit/cli/strategy_commands.rb', line 109

def trace
  puts "Makit Trace Status:"
  puts "=" * 30

  status = Makit::Rake.status

  puts "Enhanced Tracing: #{Makit::Rake.tracing_enabled? ? "Enabled" : "Disabled"}"
  puts "Rake Trace: #{status[:trace_controller][:rake_trace] || "Not set"}"
  puts "Trace Flag: #{status[:trace_controller][:trace_flag] ? "Present" : "Not present"}"
  puts "Makit Trace: #{status[:trace_controller][:makit_trace] || "Not set"}"
  puts "Verbose Mode: #{status[:verbose] ? "Enabled" : "Disabled"}"

  if options[:verbose]
    puts "\nDetailed Information:"
    puts "  Strategy: #{status[:strategy][:type] || "Unknown"}"
    puts "  Class: #{status[:strategy][:class] || "Unknown"}"
    puts "  Factory Info: #{status[:strategy][:factory_info] || "Not available"}"
  end
end