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

dev: 优化 Easydict 启动代码,改进崩溃日志记录 #553

Open
tisfeng opened this issue May 14, 2024 · 2 comments
Open

dev: 优化 Easydict 启动代码,改进崩溃日志记录 #553

tisfeng opened this issue May 14, 2024 · 2 comments
Assignees
Labels

Comments

@tisfeng
Copy link
Owner

tisfeng commented May 14, 2024

起因

看到一些用户反馈 #547 (comment) ,明明发生了程序崩溃,却获取不到有用的日志信息。

很奇怪,我打断点发现应用启动会先执行 SwiftUI 中的 @main 入口,然后才会执行 AppDelegate 中的代理方法(到这里才启动崩溃日志捕获),因此如果某些特殊情况下,应用启动后就在 SwiftUI 入口崩溃,可能获取不到崩溃日志。(存疑 🤔)

改进

优化 Easydict 启动代码,尽早开启崩溃日志捕获。

@main
enum EasydictCmpatibilityEntry {
    static func main() {
        parseArmguments()
        if Configuration.shared.enableBetaNewApp {
            EasydictApp.main()
        } else {
            _ = NSApplicationMain(CommandLine.argc, CommandLine.unsafeArgv)
        }
    }
}
image
@tisfeng tisfeng added the dev label May 14, 2024
@tisfeng
Copy link
Owner Author

tisfeng commented May 14, 2024

既然这个 issue #534 已经改为支持 macOS 13.0,那旧的启动页 Main.storyboard 也可以移除了,这个也一并给你吧 @AkaShark

@AkaShark
Copy link
Collaborator

既然这个 issue #534 已经改为支持 macOS 13.0,那旧的启动页 Main.storyboard 也可以移除了,这个也一并给你吧 @AkaShark

okay

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

No branches or pull requests

2 participants