github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/libkb/rpc_log.go (about) 1 // Copyright 2015 Keybase, Inc. All rights reserved. Use of 2 // this source code is governed by the included BSD license. 3 4 package libkb 5 6 import ( 7 "net" 8 9 "github.com/keybase/go-framed-msgpack-rpc/rpc" 10 ) 11 12 type RPCLogFactory struct { 13 Contextified 14 } 15 16 func NewRPCLogFactory(g *GlobalContext) *RPCLogFactory { 17 return &RPCLogFactory{Contextified: NewContextified(g)} 18 } 19 20 func (r *RPCLogFactory) NewLog(a net.Addr) rpc.LogInterface { 21 opts := rpc.NewStandardLogOptions(r.G().Env.GetLocalRPCDebug(), r.G().Log) 22 ret := rpc.SimpleLog{Addr: a, Out: r.G().GetUnforwardedLogger(), Opts: opts} 23 ret.TransportStart() 24 return ret 25 }