Fix логгирование не убиралось при компиляции

This commit is contained in:
Victor 2015-04-16 23:22:46 +03:00
parent 0a2718a3fd
commit 74c2b3264b
3 changed files with 9 additions and 13 deletions

View File

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

View File

@ -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;
}
// антизацикливание

View File

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