av激情亚洲男人的天堂国语,日韩欧美精品一中文字幕,无码av一区二区三区无码,国产又色又爽又刺激的a片,国产又色又爽又刺激的a片

創(chuàng)新互聯(lián)GoFrame教程:GoFrame日志組件-Flags特性

?flags?用于控制日志組件的額外特性開關(guān),這些屬性使用常量進(jìn)行組合控制,包括:

F_ASYNC      = 1 << iota // 開啟日志異步輸出
F_FILE_LONG              // 打印調(diào)用行號信息,完整絕對路徑,例如:/a/b/c/d.GO:23
F_FILE_SHORT             // 打印調(diào)用行號信息,僅打印文件名,例如:d.go:23,覆蓋 F_FILE_LONG.
F_TIME_DATE              // 打印當(dāng)前日期,如:2009-01-23
F_TIME_TIME              // 打印當(dāng)前時(shí)間,如:01:23:23
F_TIME_MILLI             // 打印當(dāng)前時(shí)間+毫秒,如:01:23:23.675
F_TIME_STD = F_TIME_DATE | F_TIME_MILLI // (默認(rèn))打印當(dāng)前日期+時(shí)間+毫秒,如:2009-01-23 01:23:23.675

使用示例:

package main

import (
	"context"

	"github.com/gogf/gf/v2/os/glog"
)

func main() {
	ctx := context.TODO()
	l := glog.New()
	l.SetFlags(glog.F_TIME_TIME | glog.F_FILE_SHORT)
	l.Print(ctx, "time and short line number")
	l.SetFlags(glog.F_TIME_MILLI | glog.F_FILE_LONG)
	l.Print(ctx, "time with millisecond and long line number")
	l.SetFlags(glog.F_TIME_STD | glog.F_FILE_LONG)
	l.Print(ctx, "standard time format and long line number")
}

執(zhí)行后,終端輸出結(jié)果為:

PS C:\hailaz\test> go run .\main.go
16:05:35 main.go:13: time and short line number 
16:05:35.108 C:/hailaz/test/main.go:15: time with millisecond and long line number 
2022-01-05 16:05:35.109 C:/hailaz/test/main.go:17: standard time format and long line number


名稱欄目:創(chuàng)新互聯(lián)GoFrame教程:GoFrame日志組件-Flags特性
網(wǎng)站URL:http://uogjgqi.cn/article/dpeesph.html
掃二維碼與項(xiàng)目經(jīng)理溝通

我們在微信上24小時(shí)期待你的聲音

解答本文疑問/技術(shù)咨詢/運(yùn)營咨詢/技術(shù)建議/互聯(lián)網(wǎng)交流