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
@@ -27,7 +27,7 @@ import java.util.HashMap;
import com.samskivert.util.MethodFinder;
import com.samskivert.util.StringUtil;
import com.threerings.presents.Log;
import static com.threerings.presents.Log.log;
/**
* Class related utility functions.
@@ -80,11 +80,11 @@ public class ClassUtil
} catch (NoSuchMethodException nsme) {
// nothing to do here but fall through and return null
Log.info("No such method [name=" + name + ", tclass=" + tclass.getName() +
log.info("No such method [name=" + name + ", tclass=" + tclass.getName() +
", args=" + StringUtil.toString(args) + ", error=" + nsme + "].");
} catch (SecurityException se) {
Log.warning("Unable to look up method? [tclass=" + tclass.getName() +
log.warning("Unable to look up method? [tclass=" + tclass.getName() +
", mname=" + name + "].");
}
@@ -23,11 +23,12 @@ package com.threerings.presents.util;
import com.samskivert.util.ResultListener;
import com.threerings.presents.Log;
import com.threerings.presents.client.InvocationService;
import com.threerings.presents.data.InvocationCodes;
import com.threerings.presents.server.InvocationException;
import static com.threerings.presents.Log.log;
/**
* Adapts the response from a {@link ResultListener} to a {@link ConfirmListener} wherein the
* result is ignored. If the failure is an instance fo {@link InvocationException} the message will
@@ -56,7 +57,7 @@ public class IgnoreConfirmAdapter<T> implements ResultListener<T>
if (cause instanceof InvocationException) {
_listener.requestFailed(cause.getMessage());
} else {
Log.logStackTrace(cause);
log.warning(cause);
_listener.requestFailed(InvocationCodes.INTERNAL_ERROR);
}
}
@@ -21,8 +21,6 @@
package com.threerings.presents.util;
import java.util.logging.Level;
import com.samskivert.util.Invoker;
import com.threerings.presents.client.InvocationService;
@@ -73,7 +71,7 @@ public abstract class PersistingUnit extends Invoker.Unit
if (error instanceof InvocationException) {
_listener.requestFailed(error.getMessage());
} else {
log.log(Level.WARNING, getFailureMessage(), error);
log.warning(getFailureMessage(), error);
_listener.requestFailed(InvocationCodes.INTERNAL_ERROR);
}
}
@@ -23,11 +23,12 @@ package com.threerings.presents.util;
import com.samskivert.util.ResultListener;
import com.threerings.presents.Log;
import com.threerings.presents.client.InvocationService;
import com.threerings.presents.data.InvocationCodes;
import com.threerings.presents.server.InvocationException;
import static com.threerings.presents.Log.log;
/**
* Adapts the response from a {@link ResultListener} to an InvocationService.ResultListener if the
* failure is an instance of {@link InvocationException} the message will be passed on to the
@@ -55,7 +56,7 @@ public class ResultAdapter<T> implements ResultListener<T>
if (cause instanceof InvocationException) {
_listener.requestFailed(cause.getMessage());
} else {
Log.logStackTrace(cause);
log.warning(cause);
_listener.requestFailed(InvocationCodes.INTERNAL_ERROR);
}
}
@@ -23,12 +23,13 @@ package com.threerings.presents.util;
import com.samskivert.util.StringUtil;
import com.threerings.presents.Log;
import com.threerings.presents.dobj.DObject;
import com.threerings.presents.dobj.DObjectManager;
import com.threerings.presents.dobj.ObjectAccessException;
import com.threerings.presents.dobj.Subscriber;
import static com.threerings.presents.Log.log;
/**
* A class that safely handles the asynchronous subscription to a
* distributed object when it is not know if the subscription will
@@ -73,7 +74,7 @@ public class SafeSubscriber<T extends DObject>
public void subscribe (DObjectManager omgr)
{
if (_active) {
Log.warning("Active safesub asked to resubscribe " + this + ".");
log.warning("Active safesub asked to resubscribe " + this + ".");
Thread.dumpStack();
return;
}
@@ -84,7 +85,7 @@ public class SafeSubscriber<T extends DObject>
// make sure we dont have an object reference (which should be
// logically impossible)
if (_object != null) {
Log.warning("Incroyable! A safesub has an object and was " +
log.warning("Incroyable! A safesub has an object and was " +
"non-active!? " + this + ".");
Thread.dumpStack();
// make do in the face of insanity
@@ -122,7 +123,7 @@ public class SafeSubscriber<T extends DObject>
if (_object == null && !_pending) {
return;
}
Log.warning("Inactive safesub asked to unsubscribe " + this + ".");
log.warning("Inactive safesub asked to unsubscribe " + this + ".");
Thread.dumpStack();
}
@@ -132,7 +133,7 @@ public class SafeSubscriber<T extends DObject>
if (_pending) {
// make sure we don't have an object reference
if (_object != null) {
Log.warning("Incroyable! A safesub has an object and is " +
log.warning("Incroyable! A safesub has an object and is " +
"pending!? " + this + ".");
Thread.dumpStack();
} else {
@@ -144,7 +145,7 @@ public class SafeSubscriber<T extends DObject>
// make sure we have our object
if (_object == null) {
Log.warning("Zut alors! A safesub _was_ active and not " +
log.warning("Zut alors! A safesub _was_ active and not " +
"pending yet has no object!? " + this + ".");
Thread.dumpStack();
// nothing to do since we're apparently already unsubscribed
@@ -161,13 +162,13 @@ public class SafeSubscriber<T extends DObject>
{
// make sure life is not too cruel
if (_object != null) {
Log.warning("Madre de dios! Our object came available but " +
log.warning("Madre de dios! Our object came available but " +
"we've already got one!? " + this);
// go ahead and pitch the old one, God knows what's going on
_object = null;
}
if (!_pending) {
Log.warning("J.C. on a pogo stick! Our object came available " +
log.warning("J.C. on a pogo stick! Our object came available " +
"but we're not pending!? " + this);
// go with our badselves, it's the only way
}
@@ -197,7 +198,7 @@ public class SafeSubscriber<T extends DObject>
{
// do the right thing with our pending state
if (!_pending) {
Log.warning("Criminy creole! Our subscribe failed but we're " +
log.warning("Criminy creole! Our subscribe failed but we're " +
"not pending!? " + this);
// go with our badselves, it's the only way
}