From 74c2b3264bea794249392823e4b9be4711253114 Mon Sep 17 00:00:00 2001 From: Victor Date: Thu, 16 Apr 2015 23:22:46 +0300 Subject: [PATCH] =?UTF-8?q?Fix=20=D0=BB=D0=BE=D0=B3=D0=B3=D0=B8=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BD=D0=B5=20=D1=83?= =?UTF-8?q?=D0=B1=D0=B8=D1=80=D0=B0=D0=BB=D0=BE=D1=81=D1=8C=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=20=D0=BA=D0=BE=D0=BC=D0=BF=D0=B8=D0=BB=D1=8F=D1=86=D0=B8?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/com/annimon/everlastingsummer/Logger.java | 10 +++------- src/com/annimon/everlastingsummer/Parser.java | 2 +- src/com/annimon/everlastingsummer/ViewActivity.java | 10 +++++----- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/com/annimon/everlastingsummer/Logger.java b/src/com/annimon/everlastingsummer/Logger.java index 43792bf..cfa1709 100644 --- a/src/com/annimon/everlastingsummer/Logger.java +++ b/src/com/annimon/everlastingsummer/Logger.java @@ -8,13 +8,11 @@ import android.util.Log; */ public final class Logger { - private static final boolean DEBUG = false; + public static final boolean DEBUG = false; private static final String TAG = "rpyplayer"; public static void log(String message) { - if (DEBUG) { - Log.d(TAG, message); - } + Log.d(TAG, message); } public static void log(Exception ex) { @@ -22,8 +20,6 @@ public final class Logger { } public static void log(String message, Exception ex) { - if (DEBUG) { - Log.e(TAG, message, ex); - } + Log.e(TAG, message, ex); } } diff --git a/src/com/annimon/everlastingsummer/Parser.java b/src/com/annimon/everlastingsummer/Parser.java index 327a7cb..70605f3 100644 --- a/src/com/annimon/everlastingsummer/Parser.java +++ b/src/com/annimon/everlastingsummer/Parser.java @@ -79,7 +79,7 @@ public final class Parser { try { terminal = statement(); } catch (RuntimeException re) { - Logger.log("Parser.next()", re); + if (Logger.DEBUG) Logger.log("Parser.next()", re); if (tokens.isEmpty()) return; } // антизацикливание diff --git a/src/com/annimon/everlastingsummer/ViewActivity.java b/src/com/annimon/everlastingsummer/ViewActivity.java index 596222b..4a0eba8 100644 --- a/src/com/annimon/everlastingsummer/ViewActivity.java +++ b/src/com/annimon/everlastingsummer/ViewActivity.java @@ -120,7 +120,7 @@ public final class ViewActivity extends Activity implements TouchGesture.OnTouch stream = null; } catch (Exception ex) { final String message = "Ошибка при открытии файла " + scriptpath; - Logger.log(message, ex); + if (Logger.DEBUG) Logger.log(message, ex); Toast.makeText(this, message, Toast.LENGTH_LONG).show(); finish(); } @@ -188,7 +188,7 @@ public final class ViewActivity extends Activity implements TouchGesture.OnTouch try { background.setImageBitmap(IOUtil.readBitmap(PathResolver.background(type, name))); } catch (Exception ioe) { - Logger.log("background: " + type + ", " + name, ioe); + if (Logger.DEBUG) Logger.log("background: " + type + ", " + name, ioe); background.setImageResource(android.R.color.black); } } @@ -220,7 +220,7 @@ public final class ViewActivity extends Activity implements TouchGesture.OnTouch if (container != img.getParent()) container.addView(img, flp); } catch (Exception ioe) { - Logger.log("sprite: " + path, ioe); + if (Logger.DEBUG) Logger.log("sprite: " + path, ioe); } } @@ -336,7 +336,7 @@ public final class ViewActivity extends Activity implements TouchGesture.OnTouch musicPlayer.setLooping(true); musicPlayer.start(); } catch (Exception e) { - Logger.log("music: " + name, e); + if (Logger.DEBUG) Logger.log("music: " + name, e); } } @@ -359,7 +359,7 @@ public final class ViewActivity extends Activity implements TouchGesture.OnTouch soundPlayer.setLooping(loop); soundPlayer.start(); } catch (Exception e) { - Logger.log("sound: " + name, e); + if (Logger.DEBUG) Logger.log("sound: " + name, e); } }