github.com/livekit/protocol@v1.39.3/logger/testutil/testutil.go (about)

     1  package testutil
     2  
     3  import (
     4  	"bytes"
     5  	"encoding/json"
     6  )
     7  
     8  type TestLogOutput struct {
     9  	Level  string
    10  	TS     float64
    11  	Caller string
    12  	Msg    string
    13  }
    14  
    15  type BufferedWriteSyncer struct {
    16  	bytes.Buffer
    17  }
    18  
    19  func (t *BufferedWriteSyncer) Unmarshal(v any) error {
    20  	return json.Unmarshal(t.Bytes(), &v)
    21  }
    22  
    23  func (t *BufferedWriteSyncer) Sync() error { return nil }