From ac7e21be48c21fa5aec64dfc0ead8ae095b4b3d7 Mon Sep 17 00:00:00 2001 From: Daniele Gobbetti Date: Fri, 12 Jun 2015 22:30:14 +0200 Subject: [PATCH] Remove the activity log debug file. This partially reverts commit 8b268a676cea3e520abeb1a8bc8aaa46329b58dd --- app/src/main/assets/logback.xml | 26 +------------------ .../gadgetbridge/GBApplication.java | 16 +++++++----- .../gadgetbridge/miband/MiBandSupport.java | 9 ------- 3 files changed, 10 insertions(+), 41 deletions(-) diff --git a/app/src/main/assets/logback.xml b/app/src/main/assets/logback.xml index 1fca7b46..f08c0b4c 100644 --- a/app/src/main/assets/logback.xml +++ b/app/src/main/assets/logback.xml @@ -28,32 +28,8 @@ - - ${GB_LOGFILES_DIR}/activity.log - - true - - - ${GB_LOGFILES_DIR}/gadgetbridge-%d{yyyy-MM-dd}.log.zip - 10 - - - 5MB - - - - %d{HH:mm:ss.SSS} %msg%n - - - - - - - - - + \ No newline at end of file diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBApplication.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBApplication.java index 123fbe0a..e4b1594b 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBApplication.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/GBApplication.java @@ -45,13 +45,15 @@ public class GBApplication extends Application { } private void setupLogging() { - File dir = getExternalFilesDir(null); - if (dir != null && !dir.exists()) { - dir.mkdirs(); - } - // used by assets/logback.xml since the location cannot be statically determined - System.setProperty("GB_LOGFILES_DIR", dir.getAbsolutePath()); - if (!isFileLoggingEnabled()) { + if (isFileLoggingEnabled()) { + File dir = getExternalFilesDir(null); + if (dir != null && !dir.exists()) { + dir.mkdirs(); + } + // used by assets/logback.xml since the location cannot be statically determined + System.setProperty("GB_LOGFILES_DIR", dir.getAbsolutePath()); + } else { + System.setProperty("GB_LOGFILES_DIR", "/dev/null"); // just to please logback configuration, not used at all try { ch.qos.logback.classic.Logger root = (ch.qos.logback.classic.Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME); root.detachAppender("FILE"); diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/miband/MiBandSupport.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/miband/MiBandSupport.java index 33bcf6e0..498a3a62 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/miband/MiBandSupport.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/miband/MiBandSupport.java @@ -49,7 +49,6 @@ import static nodomain.freeyourgadget.gadgetbridge.miband.MiBandConst.getNotific public class MiBandSupport extends AbstractBTLEDeviceSupport { private static final Logger LOG = LoggerFactory.getLogger(MiBandSupport.class); - private static final Logger ACTIVITYLOG = LoggerFactory.getLogger("activity"); //temporary buffer, size is a multiple of 60 because we want to store complete minutes (1 minute = 3 bytes) private static final int activityDataHolderSize = 60 * 24; // 8h @@ -453,7 +452,6 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport { } private void handleActivityNotif(byte[] value) { - LOG.info("handleActivityNotif GOT " + value.length + " BYTES."); if (value.length == 11 ) { // byte 0 is the data type: 1 means that each minute is represented by a triplet of bytes int dataType = value[0]; @@ -534,13 +532,6 @@ public class MiBandSupport extends AbstractBTLEDeviceSupport { intensity, steps, category); - - ACTIVITYLOG.info( - " timestamp:"+DateFormat.getDateTimeInstance().format(timestamp.getTime()).toString() + - " category:"+ category+ - " intensity:"+intensity+ - " steps:"+steps - ); timestamp.add(Calendar.MINUTE, 1); } }