Changed a bunch of Thread.dumpStack() calls into stack traces properly logged

via the logging system.


git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@806 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Michael Bayne
2009-03-24 18:47:15 +00:00
parent 139e900b44
commit 3b70248329
5 changed files with 15 additions and 19 deletions
@@ -44,9 +44,8 @@ public abstract class CardGameController extends GameController
{ {
if (_ctx.getClient().getClientObject().receivers.containsKey( if (_ctx.getClient().getClientObject().receivers.containsKey(
CardGameDecoder.RECEIVER_CODE)) { CardGameDecoder.RECEIVER_CODE)) {
log.warning("Yuh oh, we already have a card game receiver " + log.warning("Yuh oh, we already have a card game receiver registered and are trying " +
"registered and are trying for another...!"); "for another...!", new Exception());
Thread.dumpStack();
} }
_ctx.getClient().getInvocationDirector().registerReceiver(new CardGameDecoder(this)); _ctx.getClient().getInvocationDirector().registerReceiver(new CardGameDecoder(this));
@@ -430,8 +430,8 @@ public class GameManager extends PlaceManager
{ {
// complain if we're already started // complain if we're already started
if (_gameobj.state == GameObject.IN_PLAY) { if (_gameobj.state == GameObject.IN_PLAY) {
log.warning("Requested to start an already in-play game [game=" + where() + "]."); log.warning("Requested to start an already in-play game", "game", where(),
Thread.dumpStack(); new Exception());
return false; return false;
} }
@@ -397,21 +397,20 @@ public abstract class PuzzleController extends GameController
// refuse to start the action if our puzzle view is hidden // refuse to start the action if our puzzle view is hidden
if (_pidx != -1 && !_panel.getBoardView().isShowing()) { if (_pidx != -1 && !_panel.getBoardView().isShowing()) {
log.warning("Refusing to start action on hidden puzzle."); log.warning("Refusing to start action on hidden puzzle.", new Exception());
Thread.dumpStack();
return; return;
} }
// refuse to start the action if it's already going // refuse to start the action if it's already going
if (_astate != ACTION_CLEARED) { if (_astate != ACTION_CLEARED) {
log.warning("Action state inappropriate for startAction()", "astate", _astate); log.warning("Action state inappropriate for startAction()", "astate", _astate,
Thread.dumpStack(); new Exception());
return; return;
} }
if (isChatting() && supportsActionPause()) { if (isChatting() && supportsActionPause()) {
log.info( log.info("Not starting action, player is chatting in a puzzle that supports " +
"Not starting action, player is chatting in a puzzle that supports pausing the action."); "pausing the action.");
return; return;
} }
@@ -138,8 +138,8 @@ public abstract class DropBoardView extends PuzzleBoardView
public void createPiece (int piece, int sx, int sy) public void createPiece (int piece, int sx, int sy)
{ {
if (sx < 0 || sy < 0 || sx >= _bwid || sy >= _bhei) { if (sx < 0 || sy < 0 || sx >= _bwid || sy >= _bhei) {
log.warning("Requested to create piece in invalid location", "sx", sx, "sy", sy); log.warning("Requested to create piece in invalid location", "sx", sx, "sy", sy,
Thread.dumpStack(); new Exception());
return; return;
} }
createPiece(piece, sx, sy, sx, sy, 0L); createPiece(piece, sx, sy, sx, sy, 0L);
@@ -165,8 +165,8 @@ public abstract class DropBoardView extends PuzzleBoardView
public void updatePiece (int piece, int sx, int sy) public void updatePiece (int piece, int sx, int sy)
{ {
if (sx < 0 || sy < 0 || sx >= _bwid || sy >= _bhei) { if (sx < 0 || sy < 0 || sx >= _bwid || sy >= _bhei) {
log.warning("Requested to update piece in invalid location", "sx", sx, "sy", sy); log.warning("Requested to update piece in invalid location", "sx", sx, "sy", sy,
Thread.dumpStack(); new Exception());
return; return;
} }
int spos = sy * _bwid + sx; int spos = sy * _bwid + sx;
@@ -186,8 +186,7 @@ public abstract class DropBoardView extends PuzzleBoardView
{ {
if (tx < 0 || ty < 0 || tx >= _bwid || ty >= _bhei) { if (tx < 0 || ty < 0 || tx >= _bwid || ty >= _bhei) {
log.warning("Requested to create and move piece to invalid location", log.warning("Requested to create and move piece to invalid location",
"tx", tx, "ty", ty); "tx", tx, "ty", ty, new Exception());
Thread.dumpStack();
return; return;
} }
Sprite sprite = createPieceSprite(piece, sx, sy); Sprite sprite = createPieceSprite(piece, sx, sy);
@@ -270,8 +270,7 @@ public class StageSceneUtil
double radius = (double)fwid/2; double radius = (double)fwid/2;
int clidx = cluster.width-2; int clidx = cluster.width-2;
if (clidx >= CLUSTER_METRICS.length/2 || clidx < 0) { if (clidx >= CLUSTER_METRICS.length/2 || clidx < 0) {
log.warning("Requested locs from invalid cluster " + cluster + "."); log.warning("Requested locs from invalid cluster " + cluster + ".", new Exception());
Thread.dumpStack();
return list; return list;
} }