Skip to content

Commit 6539958

Browse files
Merge pull request #299 from wahabniazi56/update-doc-of-customLogger
Update ios-sdk.mdx
2 parents e5f43ce + ddc06ca commit 6539958

File tree

1 file changed

+26
-1
lines changed
  • src/content/docs/developer-tools/sdks/native

1 file changed

+26
-1
lines changed

src/content/docs/developer-tools/sdks/native/ios-sdk.mdx

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,38 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
9999
func application(...) {
100100
...
101101
// The Kinde authentication service must be configured before use
102-
KindeSDKAPI.configure(logger: Logger())
102+
KindeSDKAPI.configure(Logger())
103103
...
104104
}
105105
...
106106
}
107107
```
108108

109+
## Custom Logger (Optional)
110+
111+
You can use your own Custom Logger as well by extending `LoggerProtocol`.
112+
113+
`CustomLogger.swift`
114+
115+
```swift
116+
...
117+
import os.log
118+
import KindeSDK
119+
...
120+
struct CustomLogger: LoggerProtocol {
121+
.....
122+
.....
123+
124+
func log(_ message: String) {
125+
print("[INFO]: \(message)")
126+
}
127+
128+
func log(error: Error) {
129+
print("[ERROR]: \(error.localizedDescription)")
130+
}
131+
}
132+
```
133+
109134
## Login and register
110135

111136
The Kinde client provides methods for an easy to implement login / register flow.

0 commit comments

Comments
 (0)