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

feat: 重定向输出panic日志到panic.log,并增加用户友好的日志模块提示。 #1067

Merged
merged 6 commits into from
Oct 15, 2024

Conversation

PaienNate
Copy link
Contributor

如题,同时提前了日志模块的初始化时机。

需要注意的是,由于重定向后,原本的控制台就不再输出panic log,所以测试运行.bat(若有)将意义不大,可考虑告知用户。

panic日志重定向按 @fy0 的描述,使用rclone的代码移植而来。

当前日志模块提示于控制台:

2024-10-15T20:23:23.138+0800 INFO SEAL kratos/zap.go:110 海豹全局日志核心已启动。当海豹出现非闪退问题时,可考虑提供data/main.log至开发者或提交至ISSUE.
2024-10-15T20:23:23.139+0800 INFO SEAL paniclog/paniclog.go:31 重定向Panic日志模块已启动,当海豹突然豹炸时,请查看data/main.log及data/panic.log,并在必要时将其提供给群友/开发者
2024-10-15T20:23:23.140+0800 INFO SEAL sealdice-core/main.go:346 SealDice1.5.0-dev当前工作路径: D:\sealdice-core

当前Panic测试日志模块输出方式为每次输出首先打印本次启动时间的分割线,输出如下:

-------- 2024-10-15 20:16:57 --------

-------- 2024-10-15 20:18:07 --------
panic: 豹豹!炸了!

goroutine 23 [running]:
main.main.func1.1.1.1()
D:/sealdice-core/main.go:272 +0x25
created by main.main.func1.1.1 in goroutine 22
D:/sealdice-core/main.go:271 +0x1a

@PaienNate PaienNate requested a review from a team October 15, 2024 12:30
JustAnotherID
JustAnotherID previously approved these changes Oct 15, 2024
main.go Show resolved Hide resolved
dependabot bot and others added 5 commits October 15, 2024 14:49
Bumps [github.com/tidwall/buntdb](https://github.com/tidwall/buntdb) from 1.3.1 to 1.3.2.
- [Commits](tidwall/buntdb@v1.3.1...v1.3.2)

---
updated-dependencies:
- dependency-name: github.com/tidwall/buntdb
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
This reverts commit 3d5b9f9.
Copy link
Contributor

@JustAnotherID JustAnotherID left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@JustAnotherID JustAnotherID merged commit 081b4b7 into sealdice:master Oct 15, 2024
2 checks passed
@PaienNate PaienNate deleted the fix_panic_log branch October 20, 2024 01:34
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

Successfully merging this pull request may close these issues.

2 participants