Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Pay attention to the HUGE logs

Pay attention to the HUGE logs

Ryo Sakaguchi

June 21, 2018
Tweet

More Decks by Ryo Sakaguchi

Other Decks in Technology

Transcript

  1. ©2018 Wantedly, Inc. Pay attention to the HUGE logs potatotips

    #52 2018/06/21 - Ryo Sakaguchi (@wakwak3125)
  2. ©2018 Wantedly, Inc.  ৽ػೳͷ։ൃ w ୺຤಺ʹଘࡏ͢ΔɺσʔλΛαʔόʔʹૹ৴͢Δػೳ  େྔσʔλͷՄೳੑ w

    ։ൃʹ͋ͨΓɺԿਓ͔ʹͦͷσʔλ͕
 ͲΕ͘Β͍ଘࡏ͢Δ͔ͷฉ͖ࠐΈΛ͢Δͱ
 ݅ͱ͔͍͏਺ࣈ͕ฦ͖ͬͯͨ  ࣮֬ʹૹ৴͍ͨ͠ w ൺֱత௕ΊͷCBDLHSPVOEKPCʹͳΔ ͜ͱͷൃ୺
  3. ©2018 Wantedly, Inc.  ৽ػೳͷ։ൃ w ୺຤಺ʹଘࡏ͢Δɺͱ͋ΔσʔλΛ͢΂ͯ
 αʔόʔʹૹ৴͢Δػೳ  େྔσʔλͷՄೳੑ

    w ։ൃʹ͋ͨΓɺԿਓ͔ʹͦͷσʔλ͕
 ͲΕ͘Β͍ଘࡏ͢Δ͔ͷฉ͖ࠐΈΛ͢Δͱ
 ݅ͱ͔͍͏਺ࣈ͕ฦ͖ͬͯͨ  ࣮֬ʹૹ৴͍ͨ͠ w ൺֱత௕ΊͷCBDLHSPVOEKPCʹͳΔ ͜ͱͷൃ୺
  4. ©2018 Wantedly, Inc. 8PSL.BOBHFS class SampleWorker : Worker() { override

    fun doWork(): Result { return if (heavyTask()) Result.SUCCESS else Result.FAILURE } private fun heavyTask(): Boolean = try { Thread.sleep(5 * 1000) true } catch (e: Exception) { false } }
  5. ©2018 Wantedly, Inc. 8PSL.BOBHFS class MainActivity : AppCompatActivity() { override

    fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) WorkManager.getInstance().enqueue(OneTimeWorkRequest.from( SampleWorker::class.java)) } }
  6. ©2018 Wantedly, Inc. 8PSL.BOBHFS class MainActivity : AppCompatActivity() { override

    fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) WorkManager.getInstance().enqueue(OneTimeWorkRequest.from( SampleWorker::class.java, SampleWorker::class.java, SampleWorker::class.java )) } }
  7. ©2018 Wantedly, Inc. wTFU-FWFM -FWFM#0%:  w 0L)UUQ-PHHJOH*OUFSDFQUPS )UUQͷϦΫΤετϩάΛు͖ग़͢JOUFSDFQUPS ͷ


    ϩάϨϕϧΛ#PEZ ͭ·Γ΄΅શ෦ Λग़ͦ͏ͱ͍ͯͨ͠ɻ w ݅ʹ͖ͭɺ,C͋Δ+40/Λ݅1045͠Α͏ͱ͠ɺͦͷ3FRVFTU#PEZΛ
 ు͖ग़ͨ͢ΊɺCZUF<>4USJOH͍ͯ͠Δͱ͜ΖͰരൃͨ͠ 3FRVFTU#PEZ͕ڊେ