Jasonette/JASONETTE-iOS

Need better way to debug and log

開放

#31 建立於 2016年11月10日

 (3 則留言) (0 個反應) (0 位負責人)JavaScript (384 個分叉)batch import
codediscussionenhancementhelp wanted

倉庫指標

星標
 (5,290 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

Currently it's not so easy to debug when something fails.

@seletz added a JasonLogAction so we can call actions like "type": "$log.debug" to see things on the XCode console, and I think that's a great first step.

But still it's hard to debug things when something goes wrong. I can think of a couple of solutions.

One is, maybe implement some sort of JasonAnalyticsAction, which can send messages to whichever analytics service users want specify (like Heap, Sentry, Mixpanel, Google Analytics, etc)

Example:

{
  "type": "$network.request",
  "options": {
    "url": "...",
    "method": "post"
  },
  "success": {
    "type": "$render"
  },
  "error": {
    "type": "$analytics.send",
    "options": {
      "provider": "mixpanel",
      "data": {
        "message": "{{$jason}}"
      }
    }
  }
}

In order for this to be possible, we need to:

  1. Update existing error actions to return meaningful messages.
  2. Write a new analytics class to handle them.

Or another option would be we could create a separate extension class to handle each analytics service.


But anyway, there can be other ways to do this, so feel free to make suggestions. This is really a pain point for a lot of people (especially the people who normally don't use XCode much) and even myself because it's such a hassle to step through each line and find out what's going on.

貢獻者指南