mirror of
https://github.com/dredx/prole.git
synced 2026-09-24 19:34:31 +00:00
- Replace direct script invocation with `$PROLE_HOME/env.sh` wrapper for consistent environment setup across all components. - Update runtime processes to dynamically resolve `$PROLE_HOME` or fallback to `$HOME/.prole`. - Deprecate `init-port-forwards.sh` script bundling; remove from LaunchAgentManager and build system. - Overhaul `env.sh` generation to include execution capability, customizable paths, and improved error handling. - Standardize app name and paths to "Prole Tools" across all files and UI elements. - Adjust build output to align with new structure, including executable naming and resource packaging.
22 lines
643 B
Swift
22 lines
643 B
Swift
import Foundation
|
|
|
|
enum Debug {
|
|
static let isEnabled: Bool = {
|
|
if let v = ProcessInfo.processInfo.environment["PROLESTATUS_DEBUG"] {
|
|
return v == "1" || v.lowercased() == "true" || v.lowercased() == "yes"
|
|
}
|
|
return false
|
|
}()
|
|
|
|
static func log(_ message: @autoclosure () -> String) {
|
|
guard isEnabled else { return }
|
|
let ts = ISO8601DateFormatter().string(from: Date())
|
|
FileHandle.standardOutput.write(("[ProleStatus] " + ts + " " + message() + "\n").data(using: .utf8)!)
|
|
}
|
|
}
|
|
|
|
@inline(__always)
|
|
func dlog(_ message: @autoclosure () -> String) {
|
|
Debug.log(message())
|
|
}
|