Skip to content

Commit 89e41ff

Browse files
authored
Merge pull request #2420 from actiontech/issue-2414
feat:Standardize the logging output to std.log to prevent it from gro…
2 parents 3ee1d9b + 1d30791 commit 89e41ff

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

sqle/driver/plugin_manager.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"time"
1010

1111
"github.com/actiontech/sqle/sqle/config"
12+
"github.com/hashicorp/go-hclog"
1213

1314
"github.com/actiontech/sqle/sqle/driver/common"
1415
driverV1 "github.com/actiontech/sqle/sqle/driver/v1"
@@ -130,6 +131,11 @@ func (pm *pluginManager) register(pp PluginProcessor) error {
130131

131132
func getClientConfig(cmdBase string, cmdArgs []string) *goPlugin.ClientConfig {
132133
return &goPlugin.ClientConfig{
134+
Logger: hclog.New(&hclog.LoggerOptions{
135+
Name: "plugin-client",
136+
Output: log.Logger().Out,
137+
Level: hclog.Trace,
138+
}),
133139
HandshakeConfig: driverV2.HandshakeConfig,
134140
VersionedPlugins: map[int]goPlugin.PluginSet{
135141
driverV1.ProtocolVersion: driverV1.PluginSet,
@@ -193,7 +199,7 @@ func (pm *pluginManager) Start(pluginDir string, pluginConfigList []config.Plugi
193199
client := goPlugin.NewClient(getClientConfig(cmdBase, cmdArgs))
194200
_, err := client.Client()
195201
if err != nil {
196-
return err
202+
return fmt.Errorf("plugin %v failed to start, error: %v Please check the sqled.log for more details", p.Name(), err)
197203
}
198204

199205
var pp PluginProcessor

0 commit comments

Comments
 (0)