Skip to content

Commit

Permalink
Updating README + chatSession cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mliao95 committed Oct 15, 2024
1 parent 97e1c49 commit 81e7277
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,31 @@ val globalConfig = GlobalConfig(region = chatConfiguration.region)
chatSession.configure(globalConfig)
```

### SDKLogger
The `SDKLogger` class is responsible for logging relevant runtime information to the console which is useful for debugging purposes. The `SDKLogger` will log key events such as establishing a connection or failures such as failing to send a message.

#### `SDKLogger.configure`
This API will allow you to override the SDK's built-in logger with your own [ChatSDKLogger](#chatsdklogger) implementation. This is especially useful in cases where you would want to store logs for debugging purposes. Attaching these logs to issues filed in this project will greatly expedite the resolution process.

```
fun configureLogger(logger: ChatSDKLogger) {
this.logger = logger
}
```

#### ChatSDKLogger
The ChatSDKLogger is an interface used for the `SDKLogger`. Users can override the `SDKLogger` with any class that implements the ChatSDKLogger interface.

```
interface ChatSDKLogger {
fun logVerbose(message: () -> String)
fun logInfo(message: () -> String)
fun logDebug(message: () -> String)
fun logWarn(message: () -> String)
fun logError(message: () -> String)
}
```

--------------------

### ChatSession APIs
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
package com.amazon.connect.chat.sdk

import android.net.Uri
import android.util.Log
import com.amazon.connect.chat.sdk.model.ChatDetails
import com.amazon.connect.chat.sdk.model.ChatEvent
import com.amazon.connect.chat.sdk.model.ContentType
import com.amazon.connect.chat.sdk.model.GlobalConfig
import com.amazon.connect.chat.sdk.model.Message
import com.amazon.connect.chat.sdk.model.MessageDirection
import com.amazon.connect.chat.sdk.model.MessageReceiptType
import com.amazon.connect.chat.sdk.model.MessageStatus
import com.amazon.connect.chat.sdk.model.TranscriptItem
import com.amazon.connect.chat.sdk.model.TranscriptResponse
import com.amazon.connect.chat.sdk.repository.ChatService
import com.amazon.connect.chat.sdk.utils.logger.SDKLogger
import com.amazonaws.services.connectparticipant.model.ScanDirection
import com.amazonaws.services.connectparticipant.model.SortKey
import com.amazonaws.services.connectparticipant.model.StartPosition
Expand Down

0 comments on commit 81e7277

Please sign in to comment.