Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Log ¶
func Log(l *zap.Logger, lvl zapcore.Level, skipResponse bool) func(handler sdkutil.Handler) sdkutil.Handler
Log is middleware which logs VK API request info.
Example ¶
package main import ( "fmt" "github.com/SevereCloud/vksdk/v2/api" sdkutil "github.com/tdakkota/vksdkutil/v3" "github.com/tdakkota/vksdkutil/v3/middleware/zapvk" "go.uber.org/zap" "go.uber.org/zap/zapcore" ) func main() { vk := sdkutil.BuildSDK("token").WithMiddleware( zapvk.Log(zap.L(), zapcore.DebugLevel, true), ).Complete() users, err := vk.UsersGet(api.Params{}) if err != nil { panic(err) } fmt.Println(users) }
Output:
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.