1 Star 0 Fork 1

常清静矣/golang-100

forked from 蓝桥云课/golang-100 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
051-longLogger.go 597 Bytes
一键复制 编辑 原始数据 按行查看 历史
konroyliu 提交于 2021-01-11 10:51 . golang-100 answer
package main
import (
"log"
"os"
)
func main() {
// You can configure the output format of a logger using
// flags https://golang.org/pkg/log/#pkg-constants
// Use log.LshortfileIf to print the filename without
// the full path and the line number or
// Use log.Llongfile to print the filename with
// the full path and the line number
// The log.Llongfile example is not included below
// because playground use different path each time
log.SetOutput(os.Stdout)
log.SetFlags(log.Llongfile)
log.Println("Hello world")
// Output:
// prog.go:19: Hello world
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/syongaaa/golang-100.git
git@gitee.com:syongaaa/golang-100.git
syongaaa
golang-100
golang-100
master

搜索帮助