refactor: use log for log

monorepo
Varun Patil 2023-09-29 10:24:41 -07:00
parent c933613d1e
commit ec9900e166
2 changed files with 8 additions and 9 deletions

View File

@ -2,7 +2,6 @@ package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
@ -112,7 +111,7 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
h.c.Configured = true
// Print loaded config
fmt.Printf("%+v\n", h.c)
log.Printf("%+v\n", h.c)
return
}
@ -213,12 +212,12 @@ func loadConfig(path string, c *Config) {
c.Configured = true
// Print loaded config
fmt.Printf("%+v\n", c)
log.Printf("%+v\n", c)
}
func main() {
if len(os.Args) >= 2 && os.Args[1] == "test" {
fmt.Println("test successful")
log.Println("test successful")
return
}
@ -259,7 +258,7 @@ func main() {
}
// Print config
fmt.Printf("%+v\n", c)
log.Printf("%+v\n", c)
// Start server
log.Println("Starting VOD server")

View File

@ -200,12 +200,12 @@ func (s *Stream) ServeFullVideo(w http.ResponseWriter, r *http.Request) error {
cmdStdOut, err := coder.StdoutPipe()
if err != nil {
fmt.Printf("FATAL: ffmpeg command stdout failed with %s\n", err)
log.Printf("FATAL: ffmpeg command stdout failed with %s\n", err)
}
cmdStdErr, err := coder.StderrPipe()
if err != nil {
fmt.Printf("FATAL: ffmpeg command stdout failed with %s\n", err)
log.Printf("FATAL: ffmpeg command stdout failed with %s\n", err)
}
err = coder.Start()
@ -529,12 +529,12 @@ func (s *Stream) transcode(startId int) {
cmdStdOut, err := s.coder.StdoutPipe()
if err != nil {
fmt.Printf("FATAL: ffmpeg command stdout failed with %s\n", err)
log.Printf("FATAL: ffmpeg command stdout failed with %s\n", err)
}
cmdStdErr, err := s.coder.StderrPipe()
if err != nil {
fmt.Printf("FATAL: ffmpeg command stdout failed with %s\n", err)
log.Printf("FATAL: ffmpeg command stdout failed with %s\n", err)
}
err = s.coder.Start()