jsonShow static method

void jsonShow(
  1. String jsonStr,
  2. String requestUri
)

打印显示json

Implementation

static void jsonShow(String jsonStr, String requestUri) {
  if (jsonStr.isEmpty) {
    _printLog('Empty/Null json content', 'log_util');
    return;
  }

  if (jsonStr.startsWith('{')) {
    Map<String, dynamic> jsonData = jsonk.json.decode(jsonStr);
    _printLog('{');
    _printMap(jsonData, 1);
    _printLog('}');
    _printLog('###DEBUG请求结束### $requestUri');
    return;
  }
  if (jsonStr.startsWith('[')) {
    List<Map<String, dynamic>> jsonData = jsonk.json.decode(jsonStr);
    _printLog('[');
    _printMapList(jsonData, 1);
    _printLog(']');
    _printLog('###DEBUG请求结束### $requestUri');
    return;
  }
  _printLog('不是Json', 'log_util');
}