Skip to content

Instantly share code, notes, and snippets.

// Autogenerated by Thrift Compiler (0.13.0)
// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
package processorinterceptortest
import(
"bytes"
"context"
"reflect"
"fmt"
@voodoo-dn
voodoo-dn / go
Last active January 21, 2020 20:28
func NewLoggerInterceptor(logger *log.Logger) HandlerInterceptor {
return func(ctx context.Context, methodName string, arg interface{}, handlerFunc HandlerFunc) (result interface{}, err error) {
handlerResult, handlerError := handlerFunc(ctx, arg)
logger.Println(json.Marshal(struct {
MethodName string `json:"method_name"`
Argument interface{} `json:"argument"`
Result interface{} `json:"result"`
}{
MethodName: methodName,