Skip to content

Commit 94691d9

Browse files
logger factory to use with anyone who wants access
1 parent 5f5b319 commit 94691d9

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

OptimizelySDK/Customization/Protocols/OPTLogger.swift

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
import Foundation
1818

19-
2019
/**
2120
* Any logger must implement these following methods.
2221
*/
@@ -70,3 +69,15 @@ extension OPTLogger {
7069
return message
7170
}
7271
}
72+
73+
@objc public class OPTLoggerFactory:NSObject {
74+
func getLogger() -> OPTLogger {
75+
if let logger = HandlerRegistryService.shared.injectComponent(service: OPTLogger.self) as? OPTLogger {
76+
return logger
77+
}
78+
79+
return DefaultLogger()
80+
}
81+
}
82+
83+

0 commit comments

Comments
 (0)