Switch to new logging API.

git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@608 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Michael Bayne
2008-05-27 20:00:28 +00:00
parent 3b7ef57a20
commit a133c7c693
91 changed files with 486 additions and 722 deletions
@@ -34,11 +34,12 @@ import com.threerings.presents.client.Client;
import com.threerings.presents.client.ClientAdapter;
import com.threerings.presents.net.UsernamePasswordCreds;
import com.threerings.micasa.Log;
import com.threerings.micasa.simulator.data.SimulatorInfo;
import com.threerings.micasa.simulator.server.SimpleServer;
import com.threerings.micasa.simulator.server.SimulatorServer;
import static com.threerings.micasa.Log.log;
/**
* The simulator application is a test harness to facilitate development
* and debugging of games.
@@ -71,12 +72,12 @@ public class SimulatorApp
try {
run();
} catch (Exception e) {
Log.warning("Simulator initialization failed " +
log.warning("Simulator initialization failed " +
"[e=" + e + "].");
}
}
public void requestFailed (Exception e) {
Log.warning("Simulator initialization failed [e=" + e + "].");
log.warning("Simulator initialization failed [e=" + e + "].");
}
});
@@ -119,13 +120,13 @@ public class SimulatorApp
// start up the client
Client client = _client.getParlorContext().getClient();
Log.info("Connecting to localhost.");
log.info("Connecting to localhost.");
client.setServer("localhost", Client.DEFAULT_SERVER_PORTS);
// we want to exit when we logged off or failed to log on
client.addClientObserver(new ClientAdapter() {
public void clientFailedToLogon (Client c, Exception cause) {
Log.info("Client failed to logon: " + cause);
log.info("Client failed to logon: " + cause);
System.exit(0);
}
public void clientDidLogoff (Client c) {
@@ -171,8 +172,7 @@ public class SimulatorApp
try {
app.start(args);
} catch (Exception e) {
Log.warning("Error starting up application.");
Log.logStackTrace(e);
log.warning("Error starting up application.", e);
}
}
@@ -32,9 +32,10 @@ import com.threerings.crowd.data.BodyObject;
import com.threerings.parlor.game.data.GameConfig;
import com.threerings.parlor.util.ParlorContext;
import com.threerings.micasa.Log;
import com.threerings.micasa.simulator.data.SimulatorInfo;
import static com.threerings.micasa.Log.log;
/**
* Responsible for top-level control of the simulator client user interface.
*/
@@ -73,7 +74,7 @@ public class SimulatorController extends Controller
return true;
}
Log.info("Unhandled action: " + action);
log.info("Unhandled action: " + action);
return false;
}
@@ -86,7 +87,7 @@ public class SimulatorController extends Controller
// documentation inherited
public void clientDidLogon (Client client)
{
Log.info("Client did logon [client=" + client + "].");
log.info("Client did logon [client=" + client + "].");
// keep the body object around for stuff
_body = (BodyObject)client.getClientObject();
@@ -110,7 +111,7 @@ public class SimulatorController extends Controller
// straightaway
} catch (Exception e) {
Log.warning("Failed to instantiate game config [class=" + _info.gameConfigClass +
log.warning("Failed to instantiate game config [class=" + _info.gameConfigClass +
", error=" + e + "].");
}
}
@@ -125,7 +126,7 @@ public class SimulatorController extends Controller
// documentation inherited
public void clientDidLogoff (Client client)
{
Log.info("Client did logoff [client=" + client + "].");
log.info("Client did logoff [client=" + client + "].");
}
protected ParlorContext _ctx;
@@ -42,7 +42,7 @@ import com.threerings.parlor.game.data.GameConfig;
import com.threerings.parlor.game.data.GameObject;
import com.threerings.parlor.game.server.GameManager;
import com.threerings.micasa.Log;
import static com.threerings.micasa.Log.log;
/**
* The simulator manager is responsible for handling the simulator services on the server side.
@@ -103,8 +103,7 @@ public class SimulatorManager
_gmgr = (GameManager)_plreg.createPlace(config);
} catch (Exception e) {
Log.warning("Unable to create game manager [e=" + e + "].");
Log.logStackTrace(e);
log.warning("Unable to create game manager [e=" + e + "].", e);
return;
}
@@ -136,7 +135,7 @@ public class SimulatorManager
}
}
public void resolutionFailed (Name username, Exception cause) {
Log.warning("Unable to create simulant body object [error=" + cause + "].");
log.warning("Unable to create simulant body object [error=" + cause + "].");
}
};
@@ -160,7 +159,7 @@ public class SimulatorManager
try {
sim = (Simulant)Class.forName(_simClass).newInstance();
} catch (Exception e) {
Log.warning("Unable to create simulant " +
log.warning("Unable to create simulant " +
"[class=" + _simClass + "].");
return;
}
@@ -177,7 +176,7 @@ public class SimulatorManager
try {
_plreg.locprov.moveTo(bobj, _gobj.getOid());
} catch (Exception e) {
Log.warning("Failed to move simulant into room " +
log.warning("Failed to move simulant into room " +
"[e=" + e + "].");
return;
}
@@ -27,7 +27,7 @@ import com.threerings.presents.server.InvocationProvider;
import com.threerings.crowd.data.BodyObject;
import com.threerings.parlor.game.data.GameConfig;
import com.threerings.micasa.Log;
import static com.threerings.micasa.Log.log;
/**
* The simulator provider handles game creation requests on the server
@@ -50,7 +50,7 @@ public class SimulatorProvider
public void createGame (ClientObject caller, GameConfig config,
String simClass, int playerCount)
{
Log.info("handleCreateGameRequest [caller=" + caller.who() +
log.info("handleCreateGameRequest [caller=" + caller.who() +
", config=" + config + ", simClass=" + simClass +
", playerCount=" + playerCount + "].");