Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore(docs): add example on initializing swift client with logging (#32629)

Guilherme Souzaf7da2bc0f997
diff --git a/apps/docs/spec/supabase_swift_v2.yml b/apps/docs/spec/supabase_swift_v2.yml
index 21d0436cef2..469259bcdb0 100644
--- a/apps/docs/spec/supabase_swift_v2.yml
+++ b/apps/docs/spec/supabase_swift_v2.yml
@@ -49,6 +49,26 @@ functions:
)
)
```
+ - id: initialize-client-with-logging
+ name: Initialize Client with Logging
+ code: |
+ ```swift
+ struct AppLogger: SupabaseLogger {
+ func log(message: SupabaseLogMessage) {
+ print(message.description)
+ }
+ }
+
+ let client = SupabaseClient(
+ supabaseURL: URL(string: "https://xyzcompany.supabase.co")!,
+ supabaseKey: "public-anon-key",
+ options: SupabaseClientOptions(
+ global: SupabaseClientOptions.GlobalOptions(
+ logger: AppLogger()
+ )
+ )
+ )
+ ```
- id: api-schemas
name: With custom schemas
code: |