W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
?goframe
?框架提供了豐富的調(diào)試功能,由?gdebug
?組件實(shí)現(xiàn)。
所謂的“調(diào)試”方法大多數(shù)和開發(fā)環(huán)境有一定關(guān)系,包含堆棧和調(diào)用鏈信息分析,并且性能往往不是特別高。
使用方式:
import "github.com/gogf/gf/v2/debug/gdebug"
接口文檔:
https://pkg.go.dev/github.com/gogf/gf/v2/debug/gdebug
方法列表:
func BinVersion() string
func BinVersionMd5() string
func Caller(skip ...int) (function string, path string, line int)
func CallerDirectory() string
func CallerFileLine() string
func CallerFileLineShort() string
func CallerFilePath() string
func CallerFunction() string
func CallerPackage() string
func CallerWithFilter(filter string, skip ...int) (function string, path string, line int)
func FuncName(f interface{}) string
func FuncPath(f interface{}) string
func GoroutineId() int
func PrintStack(skip ...int)
func Stack(skip ...int) string
func StackWithFilter(filter string, skip ...int) string
func StackWithFilters(filters []string, skip ...int) string
func TestDataPath(names ...string) string
熟悉PHP的同學(xué)可能比較好理解,這里某些方法其實(shí)和PHP的部分魔術(shù)常量功能一致。?CallerDirectory
?對應(yīng)?__DIR__
?,?CallerFilePath
?對應(yīng)?__FILE__
?,?CallerFunction
?對應(yīng)?__FUNCTION__
?。
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: