From 50a250d07ff8eba6a0a018cccbd4dad79ef49cf1 Mon Sep 17 00:00:00 2001 From: Thom Shutt Date: Tue, 11 Oct 2022 10:37:02 +0100 Subject: [PATCH] Add logging to Mist Client --- clients/mist_client.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/clients/mist_client.go b/clients/mist_client.go index 680ea390b..78ecf3344 100644 --- a/clients/mist_client.go +++ b/clients/mist_client.go @@ -9,6 +9,8 @@ import ( "net/http" "net/url" "sync" + + "github.com/livepeer/catalyst-api/config" ) type MistAPIClient interface { @@ -28,16 +30,19 @@ type MistClient struct { } func (mc *MistClient) AddStream(streamName, sourceUrl string) error { + _ = config.Logger.Log("msg", "mistClient.AddStream", "streamName", streamName, "sourceURL", sourceUrl) c := commandAddStream(streamName, sourceUrl) return wrapErr(validateAddStream(mc.sendCommand(c)), streamName) } func (mc *MistClient) PushStart(streamName, targetURL string) error { + _ = config.Logger.Log("msg", "mistClient.PushStart", "streamName", streamName, "targetURL", targetURL) c := commandPushStart(streamName, targetURL) return wrapErr(validatePushStart(mc.sendCommand(c)), streamName) } func (mc *MistClient) DeleteStream(streamName string) error { + _ = config.Logger.Log("msg", "mistClient.DeleteStream", "streamName", streamName) c := commandDeleteStream(streamName) return wrapErr(validateDeleteStream(mc.sendCommand(c)), streamName) } @@ -50,6 +55,7 @@ func (mc *MistClient) DeleteStream(streamName string) error { // 4. Override the triggers // 5. Release the lock func (mc *MistClient) AddTrigger(streamName, triggerName string) error { + _ = config.Logger.Log("msg", "mistClient.AddTrigger", "streamName", streamName, "triggerName", triggerName) mc.configMu.Lock() defer mc.configMu.Unlock() @@ -70,6 +76,7 @@ func (mc *MistClient) AddTrigger(streamName, triggerName string) error { // 4. Override the triggers // 5. Release the lock func (mc *MistClient) DeleteTrigger(streamName, triggerName string) error { + _ = config.Logger.Log("msg", "mistClient.DeleteTrigger", "streamName", streamName, "triggerName", triggerName) mc.configMu.Lock() defer mc.configMu.Unlock()