From 3ed5a0b7f33962779350ed1bf711226f632eef44 Mon Sep 17 00:00:00 2001 From: Gabe Kangas Date: Mon, 5 Jun 2023 08:44:14 -0700 Subject: [PATCH] feat: simplify console logs --- core/core.go | 6 ++++-- core/streamState.go | 2 +- core/transcoder/transcoder.go | 7 ++++--- router/router.go | 8 ++++++-- 4 files changed, 15 insertions(+), 8 deletions(-) diff --git a/core/core.go b/core/core.go index bf43ebb42..5b6e28262 100644 --- a/core/core.go +++ b/core/core.go @@ -76,7 +76,9 @@ func Start() error { go rtmp.Start(setStreamAsConnected, setBroadcaster) rtmpPort := data.GetRTMPPortNumber() - log.Infof("RTMP is accepting inbound streams on port %d.", rtmpPort) + if rtmpPort != 1935 { + log.Infof("RTMP is accepting inbound streams on port %d.", rtmpPort) + } webhooks.SetupWebhooks(GetStatus) @@ -108,7 +110,7 @@ func transitionToOfflineVideoStreamContent() { } _transcoder.SetInput(offlineFilePath) - go _transcoder.Start() + go _transcoder.Start(false) // Copy the logo to be the thumbnail logo := data.GetLogoPath() diff --git a/core/streamState.go b/core/streamState.go index 99db86f76..05eca220b 100644 --- a/core/streamState.go +++ b/core/streamState.go @@ -65,7 +65,7 @@ func setStreamAsConnected(rtmpOut *io.PipeReader) { _currentBroadcast = nil } _transcoder.SetStdin(rtmpOut) - _transcoder.Start() + _transcoder.Start(true) }() go webhooks.SendStreamStatusEvent(models.StreamStarted) diff --git a/core/transcoder/transcoder.go b/core/transcoder/transcoder.go index 7a84d3714..ff1bbaa72 100644 --- a/core/transcoder/transcoder.go +++ b/core/transcoder/transcoder.go @@ -55,7 +55,6 @@ type HLSVariant struct { isVideoPassthrough bool // Override all settings and just copy the video stream isAudioPassthrough bool // Override all settings and just copy the audio stream - } // VideoSize is the scaled size of the video output. @@ -112,11 +111,13 @@ func (t *Transcoder) Stop() { } // Start will execute the transcoding process with the settings previously set. -func (t *Transcoder) Start() { +func (t *Transcoder) Start(shouldLog bool) { _lastTranscoderLogMessage = "" command := t.getString() - log.Infof("Video transcoder started using %s with %d stream variants.", t.codec.DisplayName(), len(t.variants)) + if shouldLog { + log.Infof("Processing video using codec %s with %d output qualities configured.", t.codec.DisplayName(), len(t.variants)) + } createVariantDirectories() if config.EnableDebugFeatures { diff --git a/router/router.go b/router/router.go index f8f181093..c1866eb5f 100644 --- a/router/router.go +++ b/router/router.go @@ -433,8 +433,12 @@ func Start() error { Handler: compress(m), } - log.Infof("Web server is listening on IP %s port %d.", ip, port) - log.Infoln("The web admin interface is available at /admin.") + if ip != "0.0.0.0" { + log.Infof("Web server is listening at %s:%d.", ip, port) + } else { + log.Infof("Web server is listening on port %d.", port) + } + log.Infoln("Configure this server by visiting /admin.") return server.ListenAndServe() }