From 3045311c0fc452ad46261ac24dd33d1be96a9232 Mon Sep 17 00:00:00 2001
From: ale <ale@incal.net>
Date: Wed, 26 May 2021 18:41:55 +0100
Subject: [PATCH] Improve transcoderd logging

---
 coordination/election/election.go | 2 --
 transcoder/transcoder.go          | 2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/coordination/election/election.go b/coordination/election/election.go
index b1e7d255..a26350d1 100644
--- a/coordination/election/election.go
+++ b/coordination/election/election.go
@@ -122,12 +122,10 @@ func (e *Election) runOnce(ctx context.Context, data string, op Op) error {
 	}
 
 	// Invoke the leader operation.
-	log.Printf("we are now the leader for %s", e.path)
 	err = op(ctx)
 
 	// Resign, if the session is still valid. Use a standalone
 	// Context to resign even on cancellation.
-	log.Printf("resigning leadership for %s", e.path)
 	rctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
 	rerr := e.election.Resign(rctx)
 	cancel()
diff --git a/transcoder/transcoder.go b/transcoder/transcoder.go
index 1bb2d154..6f986e56 100644
--- a/transcoder/transcoder.go
+++ b/transcoder/transcoder.go
@@ -83,6 +83,8 @@ func (t *transcoder) run(ctx context.Context) error {
 		return err
 	}
 
+	log.Printf("starting transcode of %s to %s", t.mount.TranscodeParams.SourcePath, t.mount.Path)
+
 	// Start liquidsoap and run until the context is canceled.
 	cmd := exec.CommandContext(ctx, *liquidsoapBin, "-T", "-U", "-v", configFile.Name())
 	cmd.Stdout = os.Stderr
-- 
GitLab