Skip to content

Commit 2596c59

Browse files
Merge pull request #282 from Iterable/bug/mob-1269-default-log-delegate
[MOB-1269] - Expose default log delegate etc to obj C.
2 parents 0493155 + 0c22766 commit 2596c59

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

swift-sdk/IterableLogging.swift

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import Foundation
77
import os
88

99
/// Will log if logLevel is >= minLogLevel
10-
public class DefaultLogDelegate: IterableLogDelegate {
10+
@objc public class DefaultLogDelegate: NSObject, IterableLogDelegate {
1111
private let minLogLevel: LogLevel // the lowest level that will be logged
1212

1313
init(minLogLevel: LogLevel = .info) {
@@ -29,19 +29,15 @@ public class DefaultLogDelegate: IterableLogDelegate {
2929
}
3030

3131
/// Will log everything
32-
public class AllLogDelegate: IterableLogDelegate {
33-
public init() {}
34-
32+
@objc public class AllLogDelegate: NSObject, IterableLogDelegate {
3533
public func log(level: LogLevel = .info, message: String) {
3634
let markedMessage = IterableLogUtil.markedMessage(level: level, message: message)
3735
print(markedMessage)
3836
}
3937
}
4038

4139
/// Will log nothing
42-
public class NoneLogDelegate: IterableLogDelegate {
43-
public init() {}
44-
40+
@objc public class NoneLogDelegate: NSObject, IterableLogDelegate {
4541
public func log(level _: LogLevel = .info, message _: String) {
4642
// Do nothing
4743
}

0 commit comments

Comments
 (0)