11import AppKit
2+ import OSLog
23
34@MainActor
45protocol StatusBarDelegate : AnyObject {
@@ -15,6 +16,7 @@ final class StatusBarManager: StatusBarManagerType {
1516 weak var delegate : StatusBarDelegate ?
1617 private var themeObserver : NSObjectProtocol ?
1718 private var isRecording = false
19+ private let logger = Logger ( subsystem: AppConstants . Logging. subsystem, category: String ( describing: StatusBarManager . self) )
1820
1921 init ( ) {
2022 setupStatusItem ( )
@@ -43,7 +45,7 @@ final class StatusBarManager: StatusBarManagerType {
4345 private func updateIconForCurrentTheme( ) {
4446 guard let button = statusItem? . button else { return }
4547
46- print ( " 🎨 updateIconForCurrentTheme called, isRecording: \( isRecording) " )
48+ logger . debug ( " 🎨 updateIconForCurrentTheme called, isRecording: \( self . isRecording, privacy : . public ) " )
4749
4850 // Always use the black icon, regardless of theme
4951 if let image = NSImage ( named: " barIcon-dark " ) {
@@ -53,29 +55,29 @@ final class StatusBarManager: StatusBarManagerType {
5355 tintedImage. isTemplate = false
5456 button. image = tintedImage
5557 button. contentTintColor = nil
56- print ( " 🎨 Applied red tinted image " )
58+ logger . debug ( " 🎨 Applied red tinted image " )
5759 } else {
5860 // Use original image
5961 let workingImage = image. copy ( ) as! NSImage
6062 workingImage. isTemplate = true
6163 button. image = workingImage
6264 button. contentTintColor = nil
63- print ( " 🎨 Applied normal image " )
65+ logger . debug ( " 🎨 Applied normal image " )
6466 }
6567 } else if let fallback = NSImage ( named: " barIcon " ) {
6668 if isRecording {
6769 // Create red-tinted version
6870 let tintedImage = createTintedImage ( from: fallback, tint: . systemRed)
6971 button. image = tintedImage
7072 button. contentTintColor = nil
71- print ( " 🎨 Applied red tinted fallback image " )
73+ logger . debug ( " 🎨 Applied red tinted fallback image " )
7274 } else {
7375 // Use original image
7476 let workingImage = fallback. copy ( ) as! NSImage
7577 workingImage. isTemplate = true
7678 button. image = workingImage
7779 button. contentTintColor = nil
78- print ( " 🎨 Applied normal fallback image " )
80+ logger . debug ( " 🎨 Applied normal fallback image " )
7981 }
8082 }
8183 }
@@ -99,10 +101,10 @@ final class StatusBarManager: StatusBarManagerType {
99101 }
100102
101103 func setRecordingState( _ recording: Bool ) {
102- print ( " 🎯 StatusBarManager.setRecordingState called with: \( recording) " )
104+ logger . info ( " 🎯 StatusBarManager.setRecordingState called with: \( recording, privacy : . public ) " )
103105 isRecording = recording
104106 updateIconForCurrentTheme ( )
105- print ( " 🎯 Icon updated, isRecording = \( isRecording) " )
107+ logger . info ( " 🎯 Icon updated, isRecording = \( self . isRecording, privacy : . public ) " )
106108 }
107109
108110 @objc private func handleButtonClick( _ sender: NSStatusBarButton ) {
0 commit comments