forked from Plemya-x/ALR
wip
This commit is contained in:
@ -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{}) {
|
||||
|
Reference in New Issue
Block a user