From 272e5fb6ccec88f5e3340bf2f28e2ed07de228f4 Mon Sep 17 00:00:00 2001 From: chenjuntao Date: Tue, 26 Feb 2019 14:49:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E4=B8=93=E6=A0=8F=E9=98=85?= =?UTF-8?q?=E8=AF=BB=E6=97=A5=E5=BF=97=E7=9A=84=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/gh/common/util/LogUtils.java | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/gh/common/util/LogUtils.java b/app/src/main/java/com/gh/common/util/LogUtils.java index 4162058e53..1e426c5f79 100644 --- a/app/src/main/java/com/gh/common/util/LogUtils.java +++ b/app/src/main/java/com/gh/common/util/LogUtils.java @@ -39,13 +39,17 @@ public class LogUtils { object.put("article_name", articleTitle); object.put("tracers", tracers); object.put("read", readTime); + JSONObject columnObject = new JSONObject(); if (specialColumn != null) { - JSONObject columnObject = new JSONObject(); columnObject.put("type", specialColumn.getType()); columnObject.put("name", specialColumn.getName()); columnObject.put("tab", specialColumn.getTab()); - object.put("special_column", columnObject); + } else { + columnObject.put("type", ""); + columnObject.put("name", ""); + columnObject.put("tab", ""); } + object.put("special_column", columnObject); } catch (JSONException e) { e.printStackTrace(); } @@ -85,13 +89,17 @@ public class LogUtils { object.put("tracers", tracers); object.put("answer_id", answerId); object.put("read", readTime); + JSONObject columnObject = new JSONObject(); if (specialColumn != null) { - JSONObject columnObject = new JSONObject(); columnObject.put("type", specialColumn.getType()); columnObject.put("name", specialColumn.getName()); columnObject.put("tab", specialColumn.getTab()); - object.put("special_column", columnObject); + } else { + columnObject.put("type", ""); + columnObject.put("name", ""); + columnObject.put("tab", ""); } + object.put("special_column", columnObject); } catch (JSONException e) { e.printStackTrace(); } @@ -114,13 +122,17 @@ public class LogUtils { object.put("question_name", questions.getTitle()); object.put("tracers", tracers); object.put("read", readTime); + JSONObject columnObject = new JSONObject(); if (specialColumn != null) { - JSONObject columnObject = new JSONObject(); columnObject.put("type", specialColumn.getType()); columnObject.put("name", specialColumn.getName()); columnObject.put("tab", specialColumn.getTab()); - object.put("special_column", columnObject); + } else { + columnObject.put("type", ""); + columnObject.put("name", ""); + columnObject.put("tab", ""); } + object.put("special_column", columnObject); } catch (JSONException e) { e.printStackTrace(); }