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:
Michael Bayne
2008-05-27 19:25:38 +00:00
parent 821760366f
commit 919112cf88
80 changed files with 440 additions and 573 deletions
@@ -26,12 +26,13 @@ import com.threerings.presents.server.InvocationException;
import com.threerings.presents.server.InvocationManager;
import com.threerings.presents.server.InvocationProvider;
import com.threerings.crowd.Log;
import com.threerings.crowd.data.BodyObject;
import com.threerings.crowd.data.CrowdCodes;
import com.threerings.crowd.data.OccupantInfo;
import com.threerings.crowd.data.Place;
import static com.threerings.crowd.Log.log;
/**
* Provides the server-side side of the body-related invocation services.
*/
@@ -76,7 +77,7 @@ public class BodyProvider
}
// update their status!
Log.debug("Setting user idle state [user=" + bobj.username + ", status=" + nstatus + "].");
log.debug("Setting user idle state [user=" + bobj.username + ", status=" + nstatus + "].");
updateOccupantStatus(bobj, bobj.location, nstatus);
}
@@ -33,10 +33,11 @@ import com.threerings.presents.server.InvocationManager;
import com.threerings.presents.server.PresentsClient;
import com.threerings.presents.server.PresentsServer;
import com.threerings.crowd.Log;
import com.threerings.crowd.chat.server.ChatProvider;
import com.threerings.crowd.data.BodyObject;
import static com.threerings.crowd.Log.log;
/**
* The crowd server extends the presents server by configuring it to use the
* extensions provided by the crowd layer to support crowd services.
@@ -143,8 +144,7 @@ public class CrowdServer 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);
}
}
@@ -30,7 +30,6 @@ import com.threerings.presents.server.InvocationManager;
import com.threerings.presents.server.InvocationProvider;
import com.threerings.presents.server.PresentsClient;
import com.threerings.crowd.Log;
import com.threerings.crowd.client.LocationService;
import com.threerings.crowd.data.BodyObject;
import com.threerings.crowd.data.LocationCodes;
@@ -39,6 +38,8 @@ import com.threerings.crowd.data.PlaceConfig;
import com.threerings.crowd.data.PlaceObject;
import com.threerings.crowd.server.CrowdServer;
import static com.threerings.crowd.Log.log;
/**
* This class provides the server end of the location services.
*/
@@ -96,7 +97,7 @@ public class LocationProvider
// make sure the place in question actually exists
PlaceManager pmgr = _plreg.getPlaceManager(placeOid);
if (pmgr == null) {
Log.info("Requested to move to non-existent place [who=" + source.who() +
log.info("Requested to move to non-existent place [who=" + source.who() +
", placeOid=" + placeOid + "].");
throw new InvocationException(NO_SUCH_PLACE);
}
@@ -105,7 +106,7 @@ public class LocationProvider
// because we don't need to update anything in distributed object world
Place place = pmgr.getLocation();
if (place.equals(source.location)) {
Log.debug("Going along with client request to move to where they already are " +
log.debug("Going along with client request to move to where they already are " +
"[source=" + source.who() + ", place=" + place + "].");
return pmgr.getConfig();
}
@@ -196,12 +197,12 @@ public class LocationProvider
}
} else {
Log.info("Body's prior location no longer around? [boid=" + bodoid +
log.info("Body's prior location no longer around? [boid=" + bodoid +
", place=" + oldloc + "].");
}
} catch (ClassCastException cce) {
Log.warning("Body claims to occupy non-PlaceObject!? [boid=" + bodoid +
log.warning("Body claims to occupy non-PlaceObject!? [boid=" + bodoid +
", place=" + oldloc + ", error=" + cce + "].");
}
@@ -24,7 +24,6 @@ package com.threerings.crowd.server;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
@@ -51,7 +50,6 @@ import com.threerings.presents.dobj.SetAdapter;
import com.threerings.presents.server.InvocationManager;
import com.threerings.presents.server.PresentsDObjectMgr;
import com.threerings.crowd.Log;
import com.threerings.crowd.data.BodyObject;
import com.threerings.crowd.data.OccupantInfo;
import com.threerings.crowd.data.Place;
@@ -62,6 +60,8 @@ import com.threerings.crowd.chat.data.SpeakMarshaller;
import com.threerings.crowd.chat.server.SpeakDispatcher;
import com.threerings.crowd.chat.server.SpeakHandler;
import static com.threerings.crowd.Log.log;
/**
* The place manager is the server-side entity that handles all place-related interaction. It
* subscribes to the place object and reacts to message and other events. Behavior specific to a
@@ -309,9 +309,8 @@ public class PlaceManager
return info;
} catch (Exception e) {
Log.warning("Failure building occupant info [where=" + where() +
", body=" + body + "].");
Log.logStackTrace(e);
log.warning("Failure building occupant info [where=" + where() +
", body=" + body + "].", e);
return null;
}
}
@@ -546,9 +545,7 @@ public class PlaceManager
*/
protected void bodyEntered (final int bodyOid)
{
if (Log.log.getLevel() == Level.FINE) {
Log.debug("Body entered [where=" + where() + ", oid=" + bodyOid + "].");
}
log.debug("Body entered", "where", where(), "oid", bodyOid);
// let our delegates know what's up
applyToDelegates(new DelegateOp() {
@@ -566,9 +563,7 @@ public class PlaceManager
*/
protected void bodyLeft (final int bodyOid)
{
if (Log.log.getLevel() == Level.FINE) {
Log.debug("Body left [where=" + where() + ", oid=" + bodyOid + "].");
}
log.debug("Body left", "where", where(), "oid", bodyOid);
// if their occupant info hasn't been removed (which may be the case if they logged off
// rather than left via a MoveTo request), we need to get it on out of here
@@ -643,7 +638,7 @@ public class PlaceManager
if (idlePeriod > 0L && _shutdownInterval == null) {
_shutdownInterval = new Interval((PresentsDObjectMgr)_omgr) {
public void expired () {
Log.debug("Unloading idle place '" + where () + "'.");
log.debug("Unloading idle place '" + where () + "'.");
shutdown();
}
};
@@ -30,12 +30,13 @@ import com.threerings.presents.dobj.RootDObjectManager;
import com.threerings.presents.server.InvocationException;
import com.threerings.presents.server.InvocationManager;
import com.threerings.crowd.Log;
import com.threerings.crowd.data.CrowdCodes;
import com.threerings.crowd.data.Place;
import com.threerings.crowd.data.PlaceConfig;
import com.threerings.crowd.data.PlaceObject;
import static com.threerings.crowd.Log.log;
/**
* The place registry keeps track of all of the active places in the server. It should be used to
* create new places and it will take care of instantiating and initializing a place manager to
@@ -197,9 +198,8 @@ public class PlaceRegistry
pmgr.init(this, _invmgr, _omgr, config);
} catch (Exception e) {
Log.logStackTrace(e);
throw new InstantiationException(
"Error creating place manager [config=" + config + "].");
log.warning(e);
throw new InstantiationException("Error creating PlaceManager for " + config);
}
// give the manager an opportunity to abort the whole process if it fails any permissions
@@ -226,8 +226,7 @@ public class PlaceRegistry
pmgr.startup(plobj);
} catch (Exception e) {
Log.warning("Error starting place manager [obj=" + plobj + ", pmgr=" + pmgr + "].");
Log.logStackTrace(e);
log.warning("Error starting place manager [obj=" + plobj + ", pmgr=" + pmgr + "].", e);
}
return pmgr;
@@ -241,7 +240,7 @@ public class PlaceRegistry
int ploid = pmgr.getPlaceObject().getOid();
// remove it from the table
if (_pmgrs.remove(ploid) == null) {
Log.warning("Requested to unmap unmapped place manager [pmgr=" + pmgr + "].");
log.warning("Requested to unmap unmapped place manager [pmgr=" + pmgr + "].");
// } else {
// Log.info("Unmapped place manager [class=" + pmgr.getClass().getName() +