Switch to new samskivert logging API.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5134 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -28,11 +28,12 @@ import com.samskivert.util.RunQueue;
|
||||
|
||||
import com.threerings.util.Name;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import com.threerings.presents.data.TestObject;
|
||||
import com.threerings.presents.dobj.*;
|
||||
import com.threerings.presents.net.*;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* A standalone test client.
|
||||
*/
|
||||
@@ -74,7 +75,7 @@ public class TestClient
|
||||
|
||||
public void clientDidLogon (Client client)
|
||||
{
|
||||
Log.info("Client did logon [client=" + client + "].");
|
||||
log.info("Client did logon [client=" + client + "].");
|
||||
|
||||
// register ourselves as a test notification receiver
|
||||
client.getInvocationDirector().registerReceiver(new TestDecoder(this));
|
||||
@@ -89,10 +90,10 @@ public class TestClient
|
||||
three.add(5);
|
||||
service.test(client, "one", 2, three, new TestService.TestFuncListener() {
|
||||
public void testSucceeded (String one, int two) {
|
||||
Log.info("Got test response [one=" + one + ", two=" + two + "].");
|
||||
log.info("Got test response [one=" + one + ", two=" + two + "].");
|
||||
}
|
||||
public void requestFailed (String reason) {
|
||||
Log.info("Urk! Request failed [reason=" + reason + "].");
|
||||
log.info("Urk! Request failed [reason=" + reason + "].");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -102,25 +103,25 @@ public class TestClient
|
||||
|
||||
public void clientObjectDidChange (Client client)
|
||||
{
|
||||
Log.info("Client object did change [client=" + client + "].");
|
||||
log.info("Client object did change [client=" + client + "].");
|
||||
}
|
||||
|
||||
public void clientDidLogoff (Client client)
|
||||
{
|
||||
Log.info("Client did logoff [client=" + client + "].");
|
||||
log.info("Client did logoff [client=" + client + "].");
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
public void objectAvailable (TestObject object)
|
||||
{
|
||||
object.addListener(this);
|
||||
Log.info("Object available: " + object);
|
||||
log.info("Object available: " + object);
|
||||
object.setBar("lawl!");
|
||||
}
|
||||
|
||||
public void requestFailed (int oid, ObjectAccessException cause)
|
||||
{
|
||||
Log.info("Object unavailable [oid=" + oid +
|
||||
log.info("Object unavailable [oid=" + oid +
|
||||
", reason=" + cause + "].");
|
||||
// nothing to do, so might as well logoff
|
||||
_client.logoff(true);
|
||||
@@ -128,7 +129,7 @@ public class TestClient
|
||||
|
||||
public void eventReceived (DEvent event)
|
||||
{
|
||||
Log.info("Got event [event=" + event + "].");
|
||||
log.info("Got event [event=" + event + "].");
|
||||
|
||||
// request that we log off
|
||||
_client.logoff(true);
|
||||
@@ -144,13 +145,13 @@ public class TestClient
|
||||
// documentation inherited from interface
|
||||
public void requestFailed (String reason)
|
||||
{
|
||||
Log.info("Urk! Request failed [reason=" + reason + "].");
|
||||
log.info("Urk! Request failed [reason=" + reason + "].");
|
||||
}
|
||||
|
||||
// documentation inherited from interface
|
||||
public void receivedTest (int one, String two)
|
||||
{
|
||||
Log.info("Received test notification [one=" + one +
|
||||
log.info("Received test notification [one=" + one +
|
||||
", two=" + two + "].");
|
||||
}
|
||||
|
||||
|
||||
@@ -24,10 +24,11 @@ package com.threerings.presents.server;
|
||||
import junit.framework.Test;
|
||||
import junit.framework.TestCase;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import com.threerings.presents.data.TestObject;
|
||||
import com.threerings.presents.dobj.*;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* Tests that the dobjmgr will not allow a destroyed object to be added to
|
||||
* an oid list.
|
||||
@@ -51,7 +52,7 @@ public class DestroyedRefTest extends TestCase
|
||||
|
||||
// when we get the attribute change, we can exit
|
||||
if (event instanceof ObjectDestroyedEvent) {
|
||||
Log.info("The upcoming object added event should be rejected.");
|
||||
log.info("The upcoming object added event should be rejected.");
|
||||
|
||||
} else if (event instanceof ObjectAddedEvent &&
|
||||
toid == _objtwo.getOid()) {
|
||||
@@ -78,7 +79,7 @@ public class DestroyedRefTest extends TestCase
|
||||
// add object one to object two twice in a row to make sure repeated
|
||||
// adds don't result in the object being listed twice
|
||||
_objtwo.addToList(_objone.getOid());
|
||||
Log.info("The following addToList() should be ignored.");
|
||||
log.info("The following addToList() should be ignored.");
|
||||
_objtwo.addToList(_objone.getOid());
|
||||
|
||||
// now that we have both objects, try to set up the reference. first
|
||||
|
||||
@@ -7,10 +7,11 @@ import java.util.ArrayList;
|
||||
|
||||
import com.samskivert.util.StringUtil;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import com.threerings.presents.client.TestService;
|
||||
import com.threerings.presents.data.ClientObject;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
/**
|
||||
* Implements the server side of the TestProvider interface.
|
||||
*/
|
||||
@@ -22,7 +23,7 @@ public class TestManager
|
||||
TestService.TestOidListener listener)
|
||||
throws InvocationException
|
||||
{
|
||||
Log.info("Handling get test oid [src=" + caller + "].");
|
||||
log.info("Handling get test oid [src=" + caller + "].");
|
||||
|
||||
// issue a test notification just for kicks
|
||||
TestSender.sendTest(caller, 1, "two");
|
||||
@@ -35,7 +36,7 @@ public class TestManager
|
||||
ArrayList<Integer> three, TestService.TestFuncListener listener)
|
||||
throws InvocationException
|
||||
{
|
||||
Log.info("Test request [one=" + one + ", two=" + two +
|
||||
log.info("Test request [one=" + one + ", two=" + two +
|
||||
", three=" + StringUtil.toString(three) + "].");
|
||||
|
||||
// and issue a response to this invocation request
|
||||
|
||||
@@ -21,10 +21,11 @@
|
||||
|
||||
package com.threerings.presents.server;
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import com.threerings.presents.data.TestObject;
|
||||
import com.threerings.presents.dobj.*;
|
||||
|
||||
import static com.threerings.presents.Log.log;
|
||||
|
||||
public class TestServer extends PresentsServer
|
||||
{
|
||||
public static TestObject testobj;
|
||||
@@ -52,8 +53,7 @@ public class TestServer extends PresentsServer
|
||||
server.init();
|
||||
server.run();
|
||||
} catch (Exception e) {
|
||||
Log.warning("Unable to initialize server.");
|
||||
Log.logStackTrace(e);
|
||||
log.warning("Unable to initialize server.", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user