Fix log import (#1957)

This commit is contained in:
澄潭
2025-03-26 20:27:53 +08:00
committed by GitHub
parent f83e66c23b
commit ea0143829d
80 changed files with 339 additions and 402 deletions

View File

@@ -19,7 +19,6 @@ import (
"fmt"
"strings"
"github.com/alibaba/higress/plugins/wasm-go/pkg/log"
"github.com/alibaba/higress/plugins/wasm-go/pkg/wrapper"
"github.com/higress-group/proxy-wasm-go-sdk/proxywasm"
"github.com/higress-group/proxy-wasm-go-sdk/proxywasm/types"
@@ -58,7 +57,7 @@ type Config struct {
enableHeaderSchema bool
}
func parseConfig(result gjson.Result, config *Config, log log.Log) error {
func parseConfig(result gjson.Result, config *Config, log wrapper.Log) error {
headerSchema := result.Get("header_schema").String()
bodySchema := result.Get("body_schema").String()
enableSwagger := result.Get("enable_swagger").Bool()
@@ -120,7 +119,7 @@ func parseConfig(result gjson.Result, config *Config, log log.Log) error {
return nil
}
func onHttpRequestHeaders(ctx wrapper.HttpContext, config Config, log log.Log) types.Action {
func onHttpRequestHeaders(ctx wrapper.HttpContext, config Config, log wrapper.Log) types.Action {
if !config.enableHeaderSchema {
return types.ActionContinue
}
@@ -162,7 +161,7 @@ func onHttpRequestHeaders(ctx wrapper.HttpContext, config Config, log log.Log) t
return types.ActionContinue
}
func onHttpRequestBody(ctx wrapper.HttpContext, config Config, body []byte, log log.Log) types.Action {
func onHttpRequestBody(ctx wrapper.HttpContext, config Config, body []byte, log wrapper.Log) types.Action {
if !config.enableBodySchema {
return types.ActionContinue
}