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); } }