This commit is contained in:
2025-04-15 01:32:02 +03:00
parent fe3acf5b85
commit 240ee852c8
12 changed files with 201 additions and 131 deletions

View File

@ -19,6 +19,7 @@ package logger
import (
"io"
"log"
"strings"
chLog "github.com/charmbracelet/log"
"github.com/hashicorp/go-hclog"
@ -55,7 +56,18 @@ func (a *HCLoggerAdapter) Log(level hclog.Level, msg string, args ...interface{}
filteredArgs = append(filteredArgs, args[i], args[i+1])
}
}
a.logger.l.Log(hclogLevelTochLog(level), msg, filteredArgs...)
/*
* Start ugly hacks
*/
var chLogLevel chLog.Level
if msg == "plugin process exited" || strings.HasPrefix(msg, "[DEBUG] plugin") {
chLogLevel = chLog.DebugLevel
} else {
chLogLevel = hclogLevelTochLog(level)
}
a.logger.l.Log(chLogLevel, msg, filteredArgs...)
}
func (a *HCLoggerAdapter) Trace(msg string, args ...interface{}) {