Fix логгирование не убиралось при компиляции
This commit is contained in:
parent
0a2718a3fd
commit
74c2b3264b
@ -8,13 +8,11 @@ import android.util.Log;
|
|||||||
*/
|
*/
|
||||||
public final class Logger {
|
public final class Logger {
|
||||||
|
|
||||||
private static final boolean DEBUG = false;
|
public static final boolean DEBUG = false;
|
||||||
private static final String TAG = "rpyplayer";
|
private static final String TAG = "rpyplayer";
|
||||||
|
|
||||||
public static void log(String message) {
|
public static void log(String message) {
|
||||||
if (DEBUG) {
|
Log.d(TAG, message);
|
||||||
Log.d(TAG, message);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void log(Exception ex) {
|
public static void log(Exception ex) {
|
||||||
@ -22,8 +20,6 @@ public final class Logger {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void log(String message, Exception ex) {
|
public static void log(String message, Exception ex) {
|
||||||
if (DEBUG) {
|
Log.e(TAG, message, ex);
|
||||||
Log.e(TAG, message, ex);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ public final class Parser {
|
|||||||
try {
|
try {
|
||||||
terminal = statement();
|
terminal = statement();
|
||||||
} catch (RuntimeException re) {
|
} catch (RuntimeException re) {
|
||||||
Logger.log("Parser.next()", re);
|
if (Logger.DEBUG) Logger.log("Parser.next()", re);
|
||||||
if (tokens.isEmpty()) return;
|
if (tokens.isEmpty()) return;
|
||||||
}
|
}
|
||||||
// антизацикливание
|
// антизацикливание
|
||||||
|
@ -120,7 +120,7 @@ public final class ViewActivity extends Activity implements TouchGesture.OnTouch
|
|||||||
stream = null;
|
stream = null;
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
final String message = "Ошибка при открытии файла " + scriptpath;
|
final String message = "Ошибка при открытии файла " + scriptpath;
|
||||||
Logger.log(message, ex);
|
if (Logger.DEBUG) Logger.log(message, ex);
|
||||||
Toast.makeText(this, message, Toast.LENGTH_LONG).show();
|
Toast.makeText(this, message, Toast.LENGTH_LONG).show();
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
@ -188,7 +188,7 @@ public final class ViewActivity extends Activity implements TouchGesture.OnTouch
|
|||||||
try {
|
try {
|
||||||
background.setImageBitmap(IOUtil.readBitmap(PathResolver.background(type, name)));
|
background.setImageBitmap(IOUtil.readBitmap(PathResolver.background(type, name)));
|
||||||
} catch (Exception ioe) {
|
} catch (Exception ioe) {
|
||||||
Logger.log("background: " + type + ", " + name, ioe);
|
if (Logger.DEBUG) Logger.log("background: " + type + ", " + name, ioe);
|
||||||
background.setImageResource(android.R.color.black);
|
background.setImageResource(android.R.color.black);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -220,7 +220,7 @@ public final class ViewActivity extends Activity implements TouchGesture.OnTouch
|
|||||||
if (container != img.getParent())
|
if (container != img.getParent())
|
||||||
container.addView(img, flp);
|
container.addView(img, flp);
|
||||||
} catch (Exception ioe) {
|
} 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.setLooping(true);
|
||||||
musicPlayer.start();
|
musicPlayer.start();
|
||||||
} catch (Exception e) {
|
} 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.setLooping(loop);
|
||||||
soundPlayer.start();
|
soundPlayer.start();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Logger.log("sound: " + name, e);
|
if (Logger.DEBUG) Logger.log("sound: " + name, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user