Jesús Pérez 85ce530733
feat: update provisioning core CLI, libraries, and plugins
Update core components including CLI, Nushell libraries, plugins system,
and utility scripts for the provisioning system.

CLI Updates:
- Command implementations
- CLI utilities and dispatching
- Help system improvements
- Command validation

Library Updates:
- Configuration management system
- Infrastructure validation
- Extension system improvements
- Secrets management
- Workspace operations
- Cache management system

Plugin System:
- Interactive form plugin (inquire)
- KCL integration plugin
- Performance optimization plugins
- Plugin registration system

Utilities:
- Build and distribution scripts
- Installation procedures
- Testing utilities
- Development tools

Documentation:
- Library module documentation
- Extension API guides
- Plugin usage guides
- Service management documentation

All changes are backward compatible. No breaking changes.
2025-12-11 21:57:05 +00:00

95 lines
2.8 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Enhanced logging system for provisioning tool
use ../config/accessor.nu *
# Check if debug mode is enabled
export def is-debug-enabled []: nothing -> bool {
(config-get "debug.enabled" false)
}
export def log-info [
message: string
context?: string
] {
let timestamp = (date now | format date '%Y-%m-%d %H:%M:%S')
let context_str = if ($context | is-not-empty) { $" [($context)]" } else { "" }
print $" ($timestamp)($context_str) ($message)"
}
export def log-success [
message: string
context?: string
] {
let timestamp = (date now | format date '%Y-%m-%d %H:%M:%S')
let context_str = if ($context | is-not-empty) { $" [($context)]" } else { "" }
print $"✅ ($timestamp)($context_str) ($message)"
}
export def log-warning [
message: string
context?: string
] {
let timestamp = (date now | format date '%Y-%m-%d %H:%M:%S')
let context_str = if ($context | is-not-empty) { $" [($context)]" } else { "" }
print $"⚠️ ($timestamp)($context_str) ($message)"
}
export def log-error [
message: string
context?: string
details?: string
] {
let timestamp = (date now | format date '%Y-%m-%d %H:%M:%S')
let context_str = if ($context | is-not-empty) { $" [($context)]" } else { "" }
let details_str = if ($details | is-not-empty) { $"\n Details: ($details)" } else { "" }
print $"🛑 ($timestamp)($context_str) ($message)($details_str)"
}
export def log-debug [
message: string
context?: string
] {
if (is-debug-enabled) {
let timestamp = (date now | format date '%Y-%m-%d %H:%M:%S')
let context_str = if ($context | is-not-empty) { $" [($context)]" } else { "" }
print $"🐛 ($timestamp)($context_str) ($message)"
}
}
export def log-step [
step: string
total_steps: int
current_step: int
context?: string
] {
let progress = $"($current_step)/($total_steps)"
let context_str = if ($context | is-not-empty) { $" [($context)]" } else { "" }
print $"🔄 ($progress)($context_str) ($step)"
}
export def log-progress [
message: string
percent: int
context?: string
] {
let context_str = if ($context | is-not-empty) { $" [($context)]" } else { "" }
print $"📊 ($context_str) ($message) ($percent)%"
}
export def log-section [
title: string
context?: string
] {
let context_str = if ($context | is-not-empty) { $" [($context)]" } else { "" }
print $""
print $"📋 ($context_str) ($title)"
print $"─────────────────────────────────────────────────────────────"
}
export def log-subsection [
title: string
context?: string
] {
let context_str = if ($context | is-not-empty) { $" [($context)]" } else { "" }
print $" 📌 ($context_str) ($title)"
}