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
+4 -28
View File
@@ -21,36 +21,12 @@
package com.threerings.whirled.zone;
import com.samskivert.util.Logger;
/**
* A placeholder class that contains a reference to the log object used by
* the Whirled Zone services.
* Contains a reference to the log object used by the Whirled Zone services.
*/
public class Log
{
public static com.samskivert.util.Log log =
new com.samskivert.util.Log("whirled.zone");
/** Convenience function. */
public static void debug (String message)
{
log.debug(message);
}
/** Convenience function. */
public static void info (String message)
{
log.info(message);
}
/** Convenience function. */
public static void warning (String message)
{
log.warning(message);
}
/** Convenience function. */
public static void logStackTrace (Throwable t)
{
log.logStackTrace(com.samskivert.util.Log.WARNING, t);
}
public static Logger log = Logger.getLogger("com.threerings.whirled.zone");
}
@@ -35,10 +35,11 @@ import com.threerings.whirled.data.SceneModel;
import com.threerings.whirled.data.SceneUpdate;
import com.threerings.whirled.util.WhirledContext;
import com.threerings.whirled.zone.Log;
import com.threerings.whirled.zone.data.ZoneSummary;
import com.threerings.whirled.zone.util.ZoneUtil;
import static com.threerings.whirled.zone.Log.log;
/**
* The zone director augments the scene services with the notion of zones. Zones are
* self-contained, connected groups of scenes. The normal scene director services can be used to
@@ -112,7 +113,7 @@ public class ZoneDirector extends BasicDirector
{
// make sure the zoneId and sceneId are valid
if (zoneId < 0 || sceneId < 0) {
Log.warning("Refusing moveTo(): invalid sceneId or zoneId " +
log.warning("Refusing moveTo(): invalid sceneId or zoneId " +
"[zoneId=" + zoneId + ", sceneId=" + sceneId + "].");
return false;
}
@@ -141,7 +142,7 @@ public class ZoneDirector extends BasicDirector
}
// issue a moveTo request
Log.info("Issuing zoned moveTo(" + ZoneUtil.toString(zoneId) +
log.info("Issuing zoned moveTo(" + ZoneUtil.toString(zoneId) +
", " + sceneId + ", " + sceneVers + ").");
_zservice.moveTo(_ctx.getClient(), zoneId, sceneId, sceneVers, this);
return true;
@@ -227,13 +228,13 @@ public class ZoneDirector extends BasicDirector
// just finish up what we're doing and assume that the repeated move request was the
// spurious one as it would be in the case of lag causing rapid-fire repeat requests
if (_scdir.movePending()) {
Log.info("Dropping forced move because we have a move pending " +
log.info("Dropping forced move because we have a move pending " +
"[pend=" + _scdir.getPendingModel() + ", rzId=" + zoneId +
", rsId=" + sceneId + "].");
return;
}
Log.info("Moving at request of server [zoneId=" + zoneId + ", sceneId=" + sceneId + "].");
log.info("Moving at request of server [zoneId=" + zoneId + ", sceneId=" + sceneId + "].");
// clear out our old scene and place data
_scdir.didLeaveScene();
// move to the new zone and scene
@@ -272,9 +273,8 @@ public class ZoneDirector extends BasicDirector
}
} catch (Throwable t) {
Log.warning("Zone observer choked during notification [data=" + data +
", obs=" + obs + "].");
Log.logStackTrace(t);
log.warning("Zone observer choked during notification [data=" + data +
", obs=" + obs + "].", t);
}
}
}
@@ -35,12 +35,13 @@ import com.threerings.whirled.server.SceneMoveHandler;
import com.threerings.whirled.server.SceneRegistry;
import com.threerings.whirled.server.WhirledServer;
import com.threerings.whirled.zone.Log;
import com.threerings.whirled.zone.client.ZoneService;
import com.threerings.whirled.zone.data.ZoneCodes;
import com.threerings.whirled.zone.data.ZoneSummary;
import com.threerings.whirled.zone.data.ZonedBodyObject;
import static com.threerings.whirled.zone.Log.log;
/**
* Handles transitioning between zones.
*/
@@ -74,7 +75,7 @@ public class ZoneMoveHandler extends AbstractSceneMoveHandler
// from interface ZoneManager.ResolutionListener
public void zoneFailedToResolve (int zoneId, Exception reason)
{
Log.warning("Unable to resolve zone [zoneId=" + zoneId + ", reason=" + reason + "].");
log.warning("Unable to resolve zone [zoneId=" + zoneId + ", reason=" + reason + "].");
_listener.requestFailed(ZoneCodes.NO_SUCH_ZONE);
}
@@ -36,12 +36,13 @@ import com.threerings.whirled.data.SceneUpdate;
import com.threerings.whirled.server.SceneManager;
import com.threerings.whirled.server.SceneRegistry;
import com.threerings.whirled.zone.Log;
import com.threerings.whirled.zone.client.ZoneService.ZoneMoveListener;
import com.threerings.whirled.zone.data.ZoneCodes;
import com.threerings.whirled.zone.data.ZoneSummary;
import com.threerings.whirled.zone.data.ZonedBodyObject;
import static com.threerings.whirled.zone.Log.log;
/**
* Provides zone related services which are presently the ability to move from zone to zone.
*/
@@ -74,7 +75,7 @@ public class ZoneProvider
throws InvocationException
{
if (!(caller instanceof ZonedBodyObject)) {
Log.warning("Request to switch zones by non-ZonedBodyObject " +
log.warning("Request to switch zones by non-ZonedBodyObject " +
"[clobj=" + caller.getClass() + "].");
throw new InvocationException(INTERNAL_ERROR);
}
@@ -93,7 +94,7 @@ public class ZoneProvider
// look up the zone manager for the zone
ZoneManager zmgr = _zonereg.getZoneManager(zoneId);
if (zmgr == null) {
Log.warning("Requested to enter a zone for which we have no manager " +
log.warning("Requested to enter a zone for which we have no manager " +
"[user=" + body.who() + ", zoneId=" + zoneId + "].");
throw new InvocationException(NO_SUCH_ZONE);
}
@@ -28,10 +28,11 @@ import com.threerings.presents.server.InvocationManager;
import com.threerings.crowd.server.PlaceRegistry;
import com.threerings.whirled.server.SceneRegistry;
import com.threerings.whirled.zone.Log;
import com.threerings.whirled.zone.data.ZoneCodes;
import com.threerings.whirled.zone.util.ZoneUtil;
import static com.threerings.whirled.zone.Log.log;
/**
* The zone registry takes care of mapping zone requests to the appropriate registered zone
* manager.
@@ -61,7 +62,7 @@ public class ZoneRegistry
{
ZoneManager old = (ZoneManager)_managers.get(zoneType);
if (old != null) {
Log.warning("Zone manager already registered with requested type [type=" + zoneType +
log.warning("Zone manager already registered with requested type [type=" + zoneType +
", old=" + old + ", new=" + manager + "].");
} else {
_managers.put(zoneType, manager);