Jasonette/JASONETTE-iOS

Need better way to debug and log

Open

#31 创建于 2016年11月10日

在 GitHub 查看
 (3 评论) (0 反应) (0 负责人)JavaScript (384 fork)batch import
codediscussionenhancementhelp wanted

仓库指标

Star
 (5,290 star)
PR 合并指标
 (30 天内没有已合并 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.

贡献者指南