降级日志

This commit is contained in:
2025-09-26 16:48:11 +08:00
parent ac0a338b76
commit 2d5d3919e2
2 changed files with 15 additions and 5 deletions

View File

@@ -83,13 +83,13 @@ func Run() {
cls, err := logger.NewTenCls(fmt.Sprintf("game-driver-%s-%v", config.C.Location, config.C.Point)) cls, err := logger.NewTenCls(fmt.Sprintf("game-driver-%s-%v", config.C.Location, config.C.Point))
if err != nil { if err != nil {
log.Println("初始化腾讯云日志服务异常: ", err) log.Println("初始化腾讯云日志服务异常: ", err)
logger.InitDevLogger()
} else {
cls.Start()
defer cls.Close()
logger.InitProLogger(cls)
} }
cls.Start()
defer cls.Close()
logger.InitProLogger(cls)
//logger.InitDevLogger()
// 应用退出时刷新所有缓冲日志 // 应用退出时刷新所有缓冲日志
defer logger.Sync() defer logger.Sync()

View File

@@ -14,51 +14,61 @@ func New(host string, port int) *Client {
} }
} }
// StartCue 播放节目
func (c *Client) StartCue(data string) error { func (c *Client) StartCue(data string) error {
msg := osc.NewMessage("/beyond/general/StartCue", data) msg := osc.NewMessage("/beyond/general/StartCue", data)
return c.o.Send(msg) return c.o.Send(msg)
} }
// EnableLaserOutput 打开激光
func (c *Client) EnableLaserOutput() error { func (c *Client) EnableLaserOutput() error {
msg := osc.NewMessage("/beyond/general/EnableLaserOutput") msg := osc.NewMessage("/beyond/general/EnableLaserOutput")
return c.o.Send(msg) return c.o.Send(msg)
} }
// DisableLaserOutput 关闭激光
func (c *Client) DisableLaserOutput() error { func (c *Client) DisableLaserOutput() error {
msg := osc.NewMessage("/beyond/general/DisableLaserOutput") msg := osc.NewMessage("/beyond/general/DisableLaserOutput")
return c.o.Send(msg) return c.o.Send(msg)
} }
// SetLaserOutput 设置激光输出
func (c *Client) SetLaserOutput(data string) error { func (c *Client) SetLaserOutput(data string) error {
msg := osc.NewMessage("/beyond/general/SetLaserOutput", data) msg := osc.NewMessage("/beyond/general/SetLaserOutput", data)
return c.o.Send(msg) return c.o.Send(msg)
} }
// SetLaserOutputColor 设置激光颜色
func (c *Client) SetLaserOutputColor(data string) error { func (c *Client) SetLaserOutputColor(data string) error {
msg := osc.NewMessage("/beyond/general/SetLaserOutputColor", data) msg := osc.NewMessage("/beyond/general/SetLaserOutputColor", data)
return c.o.Send(msg) return c.o.Send(msg)
} }
// SetLaserOutputIntensity 设置激光强度
func (c *Client) SetLaserOutputIntensity(data string) error { func (c *Client) SetLaserOutputIntensity(data string) error {
msg := osc.NewMessage("/beyond/general/SetLaserOutputIntensity", data) msg := osc.NewMessage("/beyond/general/SetLaserOutputIntensity", data)
return c.o.Send(msg) return c.o.Send(msg)
} }
// SetLaserOutputPosition 设置激光位置
func (c *Client) SetLaserOutputPosition(data string) error { func (c *Client) SetLaserOutputPosition(data string) error {
msg := osc.NewMessage("/beyond/general/SetLaserOutputPosition", data) msg := osc.NewMessage("/beyond/general/SetLaserOutputPosition", data)
return c.o.Send(msg) return c.o.Send(msg)
} }
// SetLaserOutputSize 设置激光尺寸
func (c *Client) SetLaserOutputSize(data string) error { func (c *Client) SetLaserOutputSize(data string) error {
msg := osc.NewMessage("/beyond/general/SetLaserOutputSize", data) msg := osc.NewMessage("/beyond/general/SetLaserOutputSize", data)
return c.o.Send(msg) return c.o.Send(msg)
} }
// SetLaserOutputSpeed 设置激光速度
func (c *Client) SetLaserOutputSpeed(data string) error { func (c *Client) SetLaserOutputSpeed(data string) error {
msg := osc.NewMessage("/beyond/general/SetLaserOutputSpeed", data) msg := osc.NewMessage("/beyond/general/SetLaserOutputSpeed", data)
return c.o.Send(msg) return c.o.Send(msg)
} }
// Status 获取状态
func (c *Client) Status() error { func (c *Client) Status() error {
msg := osc.NewMessage("/beyond/general/Status") msg := osc.NewMessage("/beyond/general/Status")
return c.o.Send(msg) return c.o.Send(msg)