33 lines
569 B
Go
Raw Normal View History

package utils
import (
"fmt"
2020-02-25 20:12:01 +02:00
"os"
2020-03-22 02:10:24 +02:00
2020-04-12 03:22:00 +03:00
config "github.com/pikami/tiktok-dl/models/config"
)
// Log - Write to std out
func Log(a ...interface{}) {
if !config.Config.Quiet {
fmt.Println(a...)
}
}
// Logf - Write formated text
func Logf(format string, a ...interface{}) {
if !config.Config.Quiet {
fmt.Printf(format, a...)
}
}
// LogFatal - Write error and panic
func LogFatal(format string, a ...interface{}) {
panic(fmt.Sprintf(format, a...))
}
2020-02-25 20:12:01 +02:00
// LogErr - Write error
func LogErr(format string, a ...interface{}) {
fmt.Fprintf(os.Stderr, format, a...)
}