Skip to content

Commit fbdbbc0

Browse files
committed
Feature: add show log shortcut in help menu
1 parent 7b32dfd commit fbdbbc0

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

ClashX/AppDelegate.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,11 @@ class AppDelegate: NSObject, NSApplicationDelegate {
298298
@IBAction func actionShowNetSpeedIndicator(_ sender: NSMenuItem) {
299299
ConfigManager.shared.showNetSpeedIndicator = !ConfigManager.shared.showNetSpeedIndicator
300300
}
301+
302+
@IBAction func actionShowLog(_ sender: Any) {
303+
NSWorkspace.shared.openFile(Logger.shared.logFilePath())
304+
305+
}
301306
}
302307

303308

ClashX/Base.lproj/Main.storyboard

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,12 @@
131131
<action selector="checkForUpdates:" target="fth-rt-saN" id="gaF-35-d7h"/>
132132
</connections>
133133
</menuItem>
134+
<menuItem title="Show Log" id="xxZ-9l-69m">
135+
<modifierMask key="keyEquivalentModifierMask"/>
136+
<connections>
137+
<action selector="actionShowLog:" target="Voe-Tx-rLC" id="riD-KO-PNs"/>
138+
</connections>
139+
</menuItem>
134140
</items>
135141
</menu>
136142
</menuItem>

ClashX/Basic/Logger.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,8 @@ class Logger {
2929
static func log(msg:String) {
3030
shared.logToFile(msg: msg)
3131
}
32+
33+
func logFilePath() -> String {
34+
return Log.logger.currentPath
35+
}
3236
}

0 commit comments

Comments
 (0)