@@ -79,15 +79,13 @@ enum AppInfo {
79
79
}
80
80
81
81
extension LoggerStore . Info . AppInfo {
82
- static func make( ) -> LoggerStore . Info . AppInfo {
83
- LoggerStore . Info. AppInfo (
84
- bundleIdentifier: AppInfo . bundleIdentifier,
85
- name: AppInfo . appName,
86
- version: AppInfo . appVersion,
87
- build: AppInfo . appBuild,
88
- icon: getAppIcon ( ) ? . base64EncodedString ( )
89
- )
90
- }
82
+ static let current = LoggerStore . Info. AppInfo (
83
+ bundleIdentifier: AppInfo . bundleIdentifier,
84
+ name: AppInfo . appName,
85
+ version: AppInfo . appVersion,
86
+ build: AppInfo . appBuild,
87
+ icon: getAppIcon ( ) ? . base64EncodedString ( )
88
+ )
91
89
}
92
90
93
91
private func getAppIcon( ) -> Data ? {
@@ -110,7 +108,7 @@ func getDeviceId() -> UUID? {
110
108
111
109
extension LoggerStore . Info . DeviceInfo {
112
110
@MainActor
113
- static func make ( ) -> LoggerStore . Info . DeviceInfo {
111
+ static let current : LoggerStore . Info . DeviceInfo = {
114
112
let device = UIDevice . current
115
113
return LoggerStore . Info. DeviceInfo (
116
114
name: device. name,
@@ -119,7 +117,7 @@ static func make() -> LoggerStore.Info.DeviceInfo {
119
117
systemName: device. systemName,
120
118
systemVersion: device. systemVersion
121
119
)
122
- }
120
+ } ( )
123
121
}
124
122
#elseif os(watchOS)
125
123
import WatchKit
@@ -131,7 +129,7 @@ func getDeviceId() -> UUID? {
131
129
132
130
extension LoggerStore . Info . DeviceInfo {
133
131
@MainActor
134
- static func make ( ) -> LoggerStore . Info . DeviceInfo {
132
+ static let current : LoggerStore . Info . DeviceInfo = {
135
133
let device = WKInterfaceDevice . current ( )
136
134
return LoggerStore . Info. DeviceInfo (
137
135
name: device. name,
@@ -140,22 +138,22 @@ static func make() -> LoggerStore.Info.DeviceInfo {
140
138
systemName: device. systemName,
141
139
systemVersion: device. systemVersion
142
140
)
143
- }
141
+ } ( )
144
142
}
145
143
#else
146
144
import AppKit
147
145
148
146
extension LoggerStore . Info . DeviceInfo {
149
147
@MainActor
150
- static func make ( ) -> LoggerStore . Info . DeviceInfo {
148
+ static let current : LoggerStore . Info . DeviceInfo = {
151
149
return LoggerStore . Info. DeviceInfo (
152
150
name: Host . current ( ) . name ?? " unknown " ,
153
151
model: " unknown " ,
154
152
localizedModel: " unknown " ,
155
153
systemName: " macOS " ,
156
154
systemVersion: ProcessInfo ( ) . operatingSystemVersionString
157
155
)
158
- }
156
+ } ( )
159
157
}
160
158
161
159
@MainActor
0 commit comments