package cmd

import (
	"gitlab.dianchu.cc/Taotie/tpro"
	"vikingar/logger"
)

var TproClient tpro.TPClient

func InitClient(addr, role string) {
	tProClient, err := tpro.NewClient(addr, role) // 新建一个客户端，并设置用户名为user1
	if err != nil {
		panic(err)
	}
	log, err := logger.NewLogger("arthur-client")
	if err != nil {
		panic(err)
	}
	tProClient.SetLogger(log)
	TproClient = tProClient
	TproClient.Start()
}
