1
1
mirror of https://gitea.com/gitea/tea synced 2024-11-23 00:12:05 +01:00
tea/cmd/log.go
2018-09-03 14:43:00 +08:00

36 lines
696 B
Go

// Copyright 2018 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package cmd
import "fmt"
var (
showLog bool
)
// Println println content according the flag
func Println(a ...interface{}) {
if showLog {
fmt.Println(a...)
}
}
// Printf printf content according the flag
func Printf(format string, a ...interface{}) {
if showLog {
fmt.Printf(format, a...)
}
}
// Error println content as an error information
func Error(a ...interface{}) {
fmt.Println(a...)
}
// Errorf printf content as an error information
func Errorf(format string, a ...interface{}) {
fmt.Printf(format, a...)
}