gf/os/glog/glog_api.go

113 lines
3.5 KiB
Go
Raw Normal View History

2019-05-21 23:57:03 +08:00
// Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
package glog
2019-05-22 20:31:14 +08:00
// Print prints <v> with newline using fmt.Sprintln.
2019-06-11 20:57:43 +08:00
// The parameter <v> can be multiple variables.
2019-05-21 23:57:03 +08:00
func Print(v ...interface{}) {
2019-06-19 09:06:52 +08:00
logger.Print(v...)
2019-05-21 23:57:03 +08:00
}
2019-05-22 20:31:14 +08:00
// Printf prints <v> with format <format> using fmt.Sprintf.
2019-06-11 20:57:43 +08:00
// The parameter <v> can be multiple variables.
2019-05-21 23:57:03 +08:00
func Printf(format string, v ...interface{}) {
2019-06-19 09:06:52 +08:00
logger.Printf(format, v...)
2019-05-21 23:57:03 +08:00
}
2019-05-22 20:31:14 +08:00
// See Print.
2019-05-21 23:57:03 +08:00
func Println(v ...interface{}) {
2019-06-19 09:06:52 +08:00
logger.Println(v...)
2019-05-21 23:57:03 +08:00
}
// Fatal prints the logging content with [FATA] header and newline, then exit the current process.
func Fatal(v ...interface{}) {
2019-06-19 09:06:52 +08:00
logger.Fatal(v...)
2019-05-21 23:57:03 +08:00
}
// Fatalf prints the logging content with [FATA] header, custom format and newline, then exit the current process.
2019-05-21 23:57:03 +08:00
func Fatalf(format string, v ...interface{}) {
2019-06-19 09:06:52 +08:00
logger.Fatalf(format, v...)
2019-05-21 23:57:03 +08:00
}
2019-05-22 20:31:14 +08:00
// Panic prints the logging content with [PANI] header and newline, then panics.
2019-05-21 23:57:03 +08:00
func Panic(v ...interface{}) {
2019-06-19 09:06:52 +08:00
logger.Panic(v...)
2019-05-21 23:57:03 +08:00
}
// Panicf prints the logging content with [PANI] header, custom format and newline, then panics.
2019-05-21 23:57:03 +08:00
func Panicf(format string, v ...interface{}) {
2019-06-19 09:06:52 +08:00
logger.Panicf(format, v...)
2019-05-21 23:57:03 +08:00
}
2019-05-22 20:31:14 +08:00
// Info prints the logging content with [INFO] header and newline.
2019-05-21 23:57:03 +08:00
func Info(v ...interface{}) {
2019-06-19 09:06:52 +08:00
logger.Info(v...)
2019-05-21 23:57:03 +08:00
}
// Infof prints the logging content with [INFO] header, custom format and newline.
2019-05-22 20:31:14 +08:00
func Infof(format string, v ...interface{}) {
logger.Infof(format, v...)
2019-05-21 23:57:03 +08:00
}
2019-05-22 20:31:14 +08:00
// Debug prints the logging content with [DEBU] header and newline.
func Debug(v ...interface{}) {
2019-06-19 09:06:52 +08:00
logger.Debug(v...)
2019-05-21 23:57:03 +08:00
}
// Debugf prints the logging content with [DEBU] header, custom format and newline.
2019-05-22 20:31:14 +08:00
func Debugf(format string, v ...interface{}) {
logger.Debugf(format, v...)
2019-05-21 23:57:03 +08:00
}
2019-05-22 20:31:14 +08:00
// Notice prints the logging content with [NOTI] header and newline.
// It also prints caller stack info if stack feature is enabled.
2019-05-22 20:31:14 +08:00
func Notice(v ...interface{}) {
2019-06-19 09:06:52 +08:00
logger.Notice(v...)
2019-05-21 23:57:03 +08:00
}
// Noticef prints the logging content with [NOTI] header, custom format and newline.
// It also prints caller stack info if stack feature is enabled.
2019-05-22 20:31:14 +08:00
func Noticef(format string, v ...interface{}) {
logger.Noticef(format, v...)
2019-05-21 23:57:03 +08:00
}
2019-05-22 20:31:14 +08:00
// Warning prints the logging content with [WARN] header and newline.
// It also prints caller stack info if stack feature is enabled.
2019-05-22 20:31:14 +08:00
func Warning(v ...interface{}) {
2019-06-19 09:06:52 +08:00
logger.Warning(v...)
2019-05-21 23:57:03 +08:00
}
// Warningf prints the logging content with [WARN] header, custom format and newline.
// It also prints caller stack info if stack feature is enabled.
2019-05-22 20:31:14 +08:00
func Warningf(format string, v ...interface{}) {
logger.Warningf(format, v...)
2019-05-21 23:57:03 +08:00
}
2019-05-22 20:31:14 +08:00
// Error prints the logging content with [ERRO] header and newline.
// It also prints caller stack info if stack feature is enabled.
2019-05-22 20:31:14 +08:00
func Error(v ...interface{}) {
2019-06-19 09:06:52 +08:00
logger.Error(v...)
2019-05-21 23:57:03 +08:00
}
// Errorf prints the logging content with [ERRO] header, custom format and newline.
// It also prints caller stack info if stack feature is enabled.
2019-05-22 20:31:14 +08:00
func Errorf(format string, v ...interface{}) {
logger.Errorf(format, v...)
2019-05-21 23:57:03 +08:00
}
2019-05-22 20:31:14 +08:00
// Critical prints the logging content with [CRIT] header and newline.
// It also prints caller stack info if stack feature is enabled.
2019-05-22 20:31:14 +08:00
func Critical(v ...interface{}) {
2019-06-19 09:06:52 +08:00
logger.Critical(v...)
2019-05-21 23:57:03 +08:00
}
// Criticalf prints the logging content with [CRIT] header, custom format and newline.
// It also prints caller stack info if stack feature is enabled.
2019-05-22 20:31:14 +08:00
func Criticalf(format string, v ...interface{}) {
2019-06-19 09:06:52 +08:00
logger.Criticalf(format, v...)
2019-05-21 23:57:03 +08:00
}