-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #216 from MaeumGaGym/Exception-refactor
PR :: 에러 로그, 응답 관련 리팩토링
- Loading branch information
Showing
17 changed files
with
177 additions
and
137 deletions.
There are no files selected for viewing
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
14 changes: 14 additions & 0 deletions
14
src/main/kotlin/com/info/maeumgagym/infrastructure/error/logger/ErrorLogger.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,14 @@ | ||
package com.info.maeumgagym.infrastructure.error.logger | ||
|
||
import com.info.maeumgagym.infrastructure.error.vo.ErrorInfo | ||
|
||
/** | ||
* [ErrorInfo]를 로그로 출력 | ||
* | ||
* @author Daybreak312 | ||
* @since 09-05-2024 | ||
*/ | ||
interface ErrorLogger { | ||
|
||
fun printLog(errorInfo: ErrorInfo) | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/kotlin/com/info/maeumgagym/infrastructure/error/logger/ErrorLoggerImpl.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,27 @@ | ||
package com.info.maeumgagym.infrastructure.error.logger | ||
|
||
import com.info.maeumgagym.infrastructure.error.vo.ErrorInfo | ||
import org.apache.commons.logging.LogFactory | ||
import org.springframework.stereotype.Component | ||
|
||
@Component | ||
class ErrorLoggerImpl : ErrorLogger { | ||
|
||
private val logger = LogFactory.getLog(javaClass) | ||
|
||
override fun printLog(errorInfo: ErrorInfo) { | ||
errorInfo.run { | ||
logger.warn( | ||
"[$id] $status : \"$message\" with exception \"$exceptionClassName\"" | ||
) | ||
|
||
logger.warn( | ||
"\tat ${errorOccurredClassName.first()}" | ||
) | ||
|
||
errorOccurredClassName.subList(1, errorOccurredClassName.size).forEach { | ||
logger.warn("\t or $it") | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.