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

在for循环中输出日志会down掉 #1

Open
ugenehan opened this issue Nov 30, 2016 · 5 comments
Open

在for循环中输出日志会down掉 #1

ugenehan opened this issue Nov 30, 2016 · 5 comments

Comments

@ugenehan
Copy link

for{
alog.Debug("Debug info...")
alog.DebugC("Debug console info...")
alog.Info("Info info...")
alog.InfoC("Info console info...")
alog.Warn("Warn info...")
alog.WarnC("Warn console info...")
alog.Error("Error info...")
alog.ErrorC("Error console info...")
alog.Fatal("Fatal info...")
alog.FatalC("Fatal console info...")
}

输出到文件中,跑几秒钟自动结束!

@LyricTian
Copy link
Member

你好,alog.Fatal会主动退出应用,明细请查看源码(manage/manage.go:279)

	if item.Level == log.FATAL {
			os.Exit(1)
	}

@ugenehan
Copy link
Author

ugenehan commented Nov 30, 2016 via email

@LyricTian
Copy link
Member

目前还不支持,这个是需要优化的地方。现在是对于日志文件按照配置累加的

@ugenehan
Copy link
Author

ugenehan commented Nov 30, 2016 via email

@LyricTian
Copy link
Member

昨天优化了一些文件存储实现,加上了日志清理机制

每条日志文件大小20M
总条数:1000000,总耗时:24.00s,每条日志长度:512B,每秒写入日志条数:41666

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

No branches or pull requests

2 participants