Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There are no logs in the console after setting up SetLogger #1090

Closed
xu756 opened this issue Apr 12, 2024 · 3 comments
Closed

There are no logs in the console after setting up SetLogger #1090

xu756 opened this issue Apr 12, 2024 · 3 comments
Labels

Comments

@xu756
Copy link

xu756 commented Apr 12, 2024

Describe the Question

我配置hlog.SetLogger。日志全部输出到了文件,控制台没有了,我想文件 控制台都有
在官网没有找到相关设置
Reproducible Code

Screenshots

If applicable, add screenshots to help explain your question.

Hertz version:

0.7.3

Environment:

GO111MODULE='on'
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/xu756/Library/Caches/go-build'
GOENV='/Users/xu756/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/xu756/开发/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/xu756/开发/go'
GOPRIVATE=''
GOPROXY='https://goproxy.cn,direct'
GOROOT='/Users/xu756/devenv/go'
GOSUMDB='sum.golang.org'

Additional context
启动函数如下

var file = flag.String("f", "configs/dev.yaml", "config file path")

func main() {
	flag.Parse()
	config.Init(*file)
	log.Printf("【 WxappApi 】addr on %s", config.RunData.Addr.WxappApiAddr)
	hlog.SetLogger(xlog.InitHertzLog("wxapp"))
	hander.Init()
	router.InitRouter()
	err := router.HttpServer.Run()
	if err != nil {
		log.Fatalf("【 WxappApi 】run error: %v", err)
	}
}
@github-actions github-actions bot added the invalid issue invalid issue (not related to Hertz or described in document or not enough information provided) label Apr 12, 2024
Copy link

This issue has been marked as invalid question, please give more information by following the issue template. The issue will be closed in 1 days if no further activity occurs.

@github-actions github-actions bot added stale and removed invalid issue invalid issue (not related to Hertz or described in document or not enough information provided) labels Apr 12, 2024
@xu756
Copy link
Author

xu756 commented Apr 12, 2024

I found a solution to this issue 769

@xu756 xu756 closed this as completed Apr 12, 2024
@li-jin-gou
Copy link
Member

Print to console performance is poor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants