github.com/v2fly/v2ray-core/v4@v4.45.2/app/log/command/command_test.go (about) 1 package command_test 2 3 import ( 4 "context" 5 "testing" 6 7 core "github.com/v2fly/v2ray-core/v4" 8 "github.com/v2fly/v2ray-core/v4/app/dispatcher" 9 "github.com/v2fly/v2ray-core/v4/app/log" 10 . "github.com/v2fly/v2ray-core/v4/app/log/command" 11 "github.com/v2fly/v2ray-core/v4/app/proxyman" 12 _ "github.com/v2fly/v2ray-core/v4/app/proxyman/inbound" 13 _ "github.com/v2fly/v2ray-core/v4/app/proxyman/outbound" 14 "github.com/v2fly/v2ray-core/v4/common" 15 "github.com/v2fly/v2ray-core/v4/common/serial" 16 ) 17 18 func TestLoggerRestart(t *testing.T) { 19 v, err := core.New(&core.Config{ 20 App: []*serial.TypedMessage{ 21 serial.ToTypedMessage(&log.Config{}), 22 serial.ToTypedMessage(&dispatcher.Config{}), 23 serial.ToTypedMessage(&proxyman.InboundConfig{}), 24 serial.ToTypedMessage(&proxyman.OutboundConfig{}), 25 }, 26 }) 27 common.Must(err) 28 common.Must(v.Start()) 29 30 server := &LoggerServer{ 31 V: v, 32 } 33 common.Must2(server.RestartLogger(context.Background(), &RestartLoggerRequest{})) 34 }