feat: add debug log stream support

This commit is contained in:
2026-04-02 23:27:46 +08:00
parent f1c16e89f0
commit 9ec25b94f1
15 changed files with 624 additions and 15 deletions

View File

@@ -1,5 +1,10 @@
package conf
import (
"os"
"strings"
)
// 构建信息
var (
Mode string = "debug"
@@ -9,4 +14,32 @@ var (
GitAuthor string = "unknown"
GitEmail string = "unknown"
GitCommit string = "unknown"
DebugProxy string = ""
DebugSkipSSLVerify bool = false
)
func init() {
if !IsDebugMode() {
return
}
if proxy := os.Getenv("CKWK_DEBUG_PROXY"); proxy != "" {
DebugProxy = proxy
}
DebugSkipSSLVerify = parseEnvBool("CKWK_DEBUG_SKIP_SSL_VERIFY")
}
func IsDebugMode() bool {
return !strings.EqualFold(Mode, "release")
}
func parseEnvBool(key string) bool {
value := strings.TrimSpace(os.Getenv(key))
switch strings.ToLower(value) {
case "1", "true", "yes", "on":
return true
default:
return false
}
}