-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PC-588] 에러 로깅 추가 #66
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
/build | ||
/build | ||
google-services.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
core/data/src/main/java/com/puzzle/data/repository/ErrorRepositoryImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package com.puzzle.data.repository | ||
|
||
import com.puzzle.domain.repository.ErrorRepository | ||
import com.puzzle.network.source.error.ErrorDataSource | ||
import javax.inject.Inject | ||
|
||
class ErrorRepositoryImpl @Inject constructor( | ||
private val errorDataSource: ErrorDataSource, | ||
) : ErrorRepository { | ||
override suspend fun logError(exception: Throwable) = errorDataSource.logError(exception) | ||
} |
10 changes: 7 additions & 3 deletions
10
core/domain/src/main/java/com/puzzle/domain/model/error/ErrorHelper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
package com.puzzle.domain.model.error | ||
|
||
import com.puzzle.domain.repository.ErrorRepository | ||
import kotlinx.coroutines.channels.Channel | ||
import kotlinx.coroutines.flow.receiveAsFlow | ||
import javax.inject.Inject | ||
import javax.inject.Singleton | ||
|
||
@Singleton | ||
class ErrorHelper @Inject constructor() { | ||
class ErrorHelper @Inject constructor( | ||
private val errorRepository: ErrorRepository, | ||
) { | ||
private val _errorEvent = Channel<Throwable>(DEFAULT_BUFFER_SIZE) | ||
val errorEvent = _errorEvent.receiveAsFlow() | ||
|
||
fun sendError(error: Throwable) { | ||
_errorEvent.trySend(error) | ||
suspend fun sendError(error: Throwable) { | ||
_errorEvent.send(error) | ||
errorRepository.logError(error) | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
core/domain/src/main/java/com/puzzle/domain/repository/ErrorRepository.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.puzzle.domain.repository | ||
|
||
interface ErrorRepository { | ||
suspend fun logError(exception: Throwable) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
core/network/src/main/java/com/puzzle/network/source/error/DebugErrorDataSourceImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.puzzle.network.source.error | ||
|
||
import android.util.Log | ||
import javax.inject.Inject | ||
|
||
class DebugErrorDataSourceImpl @Inject constructor() : ErrorDataSource { | ||
override suspend fun logError(exception: Throwable) { | ||
Log.e("DebugErrorDataSource", exception.stackTraceToString()) | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
core/network/src/main/java/com/puzzle/network/source/error/ErrorDataSource.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package com.puzzle.network.source.error | ||
|
||
interface ErrorDataSource { | ||
suspend fun logError(exception: Throwable) | ||
} |
12 changes: 12 additions & 0 deletions
12
core/network/src/main/java/com/puzzle/network/source/error/ErrorDataSourceImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.puzzle.network.source.error | ||
|
||
import com.google.firebase.crashlytics.FirebaseCrashlytics | ||
import javax.inject.Inject | ||
|
||
class ErrorDataSourceImpl @Inject constructor( | ||
private val firebaseCrashlytics: FirebaseCrashlytics, | ||
) : ErrorDataSource { | ||
override suspend fun logError(exception: Throwable) { | ||
firebaseCrashlytics.recordException(exception) | ||
} | ||
} | ||
Comment on lines
+6
to
+12
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 👍 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 👍