mirror of
https://github.com/pikami/tiktok-dl.git
synced 2026-01-31 07:32:55 +00:00
TTDL-7 Added flag; Code clean up
This commit is contained in:
32
utils/log/log.go
Normal file
32
utils/log/log.go
Normal file
@@ -0,0 +1,32 @@
|
||||
package utils
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
config "../../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...))
|
||||
}
|
||||
|
||||
// LogErr - Write error
|
||||
func LogErr(format string, a ...interface{}) {
|
||||
fmt.Fprintf(os.Stderr, format, a...)
|
||||
}
|
||||
Reference in New Issue
Block a user