Switch to new logging API.

git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@510 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
Michael Bayne
2008-05-27 22:55:10 +00:00
parent b521b4bfbf
commit e00b4ddd6b
108 changed files with 497 additions and 605 deletions
@@ -25,7 +25,7 @@ import java.awt.Graphics;
import java.awt.Rectangle;
import java.awt.image.BufferedImage;
import com.threerings.media.Log;
import static com.threerings.media.Log.log;
/**
* Provides a volatile mirage that is backed by a buffered image that is
@@ -63,8 +63,7 @@ public class BackedVolatileMirage extends VolatileMirage
gfx.drawImage(_source, -_bounds.x, -_bounds.y, null);
} catch (Exception e) {
Log.warning("Failure refreshing mirage " + this + ".");
Log.logStackTrace(e);
log.warning("Failure refreshing mirage " + this + ".", e);
} finally {
gfx.dispose();
@@ -26,7 +26,7 @@ import java.awt.Rectangle;
import java.awt.Transparency;
import java.awt.image.BufferedImage;
import com.threerings.media.Log;
import static com.threerings.media.Log.log;
/**
* A mirage implementation which allows the image to be maintained in
@@ -76,8 +76,7 @@ public class CachedVolatileMirage extends VolatileMirage
}
} catch (Exception e) {
Log.warning("Failure refreshing mirage " + this + ".");
Log.logStackTrace(e);
log.warning("Failure refreshing mirage " + this + ".", e);
} finally {
if (gfx != null) {
@@ -36,10 +36,11 @@ import com.samskivert.util.HashIntMap;
import com.samskivert.util.RandomUtil;
import com.samskivert.util.StringUtil;
import com.threerings.media.Log;
import com.threerings.resource.ResourceManager;
import com.threerings.util.CompiledConfig;
import static com.threerings.media.Log.log;
/**
* A repository of image recoloration information. It was called the
* recolor repository but the re-s cancelled one another out.
@@ -81,7 +82,7 @@ public class ColorPository implements Serializable
{
// validate the color id
if (record.colorId > 255) {
Log.warning("Refusing to add color record; colorId > 255 " +
log.warning("Refusing to add color record; colorId > 255 " +
"[class=" + this + ", record=" + record + "].");
} else {
record.cclass = this;
@@ -145,7 +146,7 @@ public class ColorPository implements Serializable
// sanity check
if (_starters.length < 1) {
Log.warning("Requested random starting color from " +
log.warning("Requested random starting color from " +
"colorless component class " + this + "].");
return null;
}
@@ -362,7 +363,7 @@ public class ColorPository implements Serializable
try {
colorId = crec.getColorId(colorName);
} catch (ParseException pe) {
Log.info("Error getting colorization by name. [error=" + pe + "]");
log.info("Error getting colorization by name. [error=" + pe + "]");
return null;
}
@@ -387,7 +388,7 @@ public class ColorPository implements Serializable
return crec;
}
}
Log.warning("No such color class [class=" + className + "].");
log.warning("No such color class [class=" + className + "].");
Thread.dumpStack();
return null;
}
@@ -402,7 +403,7 @@ public class ColorPository implements Serializable
// if they request color class zero, we assume they're just
// decoding a blank colorprint, otherwise we complain
if (classId != 0) {
Log.warning("Requested unknown color class " +
log.warning("Requested unknown color class " +
"[classId=" + classId +
", colorId=" + colorId + "].");
Thread.dumpStack();
@@ -419,7 +420,7 @@ public class ColorPository implements Serializable
{
ClassRecord record = getClassRecord(className);
if (record == null) {
Log.warning("Requested unknown color class " +
log.warning("Requested unknown color class " +
"[className=" + className + ", colorName=" + colorName + "].");
Thread.dumpStack();
return null;
@@ -429,7 +430,7 @@ public class ColorPository implements Serializable
try {
colorId = record.getColorId(colorName);
} catch (ParseException pe) {
Log.info("Error getting color record by name. [error=" + pe + "]");
log.info("Error getting color record by name. [error=" + pe + "]");
return null;
}
@@ -444,7 +445,7 @@ public class ColorPository implements Serializable
{
// validate the class id
if (record.classId > 255) {
Log.warning("Refusing to add class; classId > 255 " + record + ".");
log.warning("Refusing to add class; classId > 255 " + record + ".");
} else {
_classes.put(record.classId, record);
}
@@ -459,7 +460,7 @@ public class ColorPository implements Serializable
try {
return loadColorPository(rmgr.getResource(CONFIG_PATH));
} catch (IOException ioe) {
Log.warning("Failure loading color pository [path=" + CONFIG_PATH +
log.warning("Failure loading color pository [path=" + CONFIG_PATH +
", error=" + ioe + "].");
return new ColorPository();
}
@@ -474,7 +475,7 @@ public class ColorPository implements Serializable
try {
return (ColorPository)CompiledConfig.loadConfig(source);
} catch (IOException ioe) {
Log.warning("Failure loading color pository: " + ioe + ".");
log.warning("Failure loading color pository: " + ioe + ".");
return new ColorPository();
}
}
@@ -488,7 +489,7 @@ public class ColorPository implements Serializable
try {
CompiledConfig.saveConfig(path, posit);
} catch (IOException ioe) {
Log.warning("Failure saving color pository " +
log.warning("Failure saving color pository " +
"[path=" + path + ", error=" + ioe + "].");
}
}
@@ -22,9 +22,10 @@ import com.samskivert.util.StringUtil;
import com.samskivert.util.Throttle;
import com.samskivert.util.Tuple;
import com.threerings.media.Log;
import com.threerings.resource.ResourceManager;
import static com.threerings.media.Log.log;
/**
* Provides a single point of access for image retrieval and caching. This does not include
* any tie-in to runtime adjustments to control caching and mirage creation.
@@ -95,7 +96,7 @@ public class ImageManager
// create our image cache
int icsize = getCacheSize();
Log.debug("Creating image cache [size=" + icsize + "k].");
log.debug("Creating image cache [size=" + icsize + "k].");
_ccache = new LRUHashMap(icsize * 1024, new LRUHashMap.ItemSizer() {
public int computeSize (Object value) {
return (int)((CacheRecord)value).getEstimatedMemoryUsage();
@@ -126,7 +127,7 @@ public class ImageManager
*/
public void clearCache ()
{
Log.info("Clearing image manager cache.");
log.info("Clearing image manager cache.");
_ccache.clear();
}
@@ -265,7 +266,7 @@ public class ImageManager
// load up the raw image
BufferedImage image = loadImage(key);
if (image == null) {
Log.warning("Failed to load image " + key + ".");
log.warning("Failed to load image " + key + ".");
// create a blank image instead
image = new BufferedImage(10, 10, BufferedImage.TYPE_BYTE_INDEXED);
}
@@ -396,15 +397,14 @@ public class ImageManager
BufferedImage image = null;
try {
Log.debug("Loading image " + key + ".");
log.debug("Loading image " + key + ".");
image = key.daprov.loadImage(key.path);
if (image == null) {
Log.warning("ImageDataProvider.loadImage(" + key + ") returned null.");
log.warning("ImageDataProvider.loadImage(" + key + ") returned null.");
}
} catch (Exception e) {
Log.warning("Unable to load image '" + key + "'.");
Log.logStackTrace(e);
log.warning("Unable to load image '" + key + "'.", e);
// create a blank image in its stead
image = createImage(1, 1, Transparency.OPAQUE);
@@ -435,7 +435,7 @@ public class ImageManager
}
eff = _ccache.getTrackedEffectiveness();
}
Log.info("ImageManager LRU [mem=" + (size / 1024) + "k, size=" + _ccache.size() +
log.info("ImageManager LRU [mem=" + (size / 1024) + "k, size=" + _ccache.size() +
", hits=" + eff[0] + ", misses=" + eff[1] + ", totalKeys=" + _keySet.size() + "].");
}
@@ -476,7 +476,7 @@ public class ImageManager
return cimage;
} catch (Exception re) {
Log.warning("Failure recoloring image [source" + _key +
log.warning("Failure recoloring image [source" + _key +
", zations=" + StringUtil.toString(zations) + ", error=" + re + "].");
// return the uncolorized version
return _source;
@@ -535,4 +535,4 @@ public class ImageManager
/** Default amount of data we'll store in our image cache. */
protected static int DEFAULT_CACHE_SIZE = 32768;
}
}
@@ -29,7 +29,7 @@ import java.awt.geom.AffineTransform;
import java.awt.geom.NoninvertibleTransformException;
import java.awt.image.BufferedImage;
import com.threerings.media.Log;
import static com.threerings.media.Log.log;
/**
* Draws a mirage combined with an arbitrary AffineTransform.