Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 |
Tags
- navigation component
- prettyJson
- itemAnimator
- BottomSheetDialog
- Android
- notification bar
- notification setting
- 이미지 gps
- ExifInterface
- jsontokotlinclass
- datastore
- Blinking
- skipcollapsed
- 403 Error
- room
- circlecrop
- Git
- onResume
- shotcut
- App Startup
- notification
- Plugins
- ChromeCustomTab
- LOG
- application
- kdoc-generator
- webview
- requestPermission
- onReceivedSslError
- ActivityResultContracts
Archives
- Today
- Total
목록prettyJson (1)
Debbi Story
[Android] OkHttpClient + Moshi response Log 보기 쉽게 출력하기!
안녕하세요. 보통 네트워크 통신 응답을 Log로 찍게되면 줄바꿈이 안되고 내용이 많을땐 짤려서 보이게 됩니다. 아래처럼 사용하시면 json형식으로 보기 쉽게 출력이 됩니다! val logger = HttpLoggingInterceptor.Logger { message -> if (!message.startsWith("{") && !message.startsWith("[")) { Timber.tag("OkHttp").d(message) return@Logger } try { val source = Buffer().writeUtf8(message) val reader = JsonReader.of(source) val value = reader.readJsonValue() val adapter = Moshi...
안드로이드/Tip
2022. 1. 3. 00:13