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
@@ -33,6 +33,8 @@ import java.awt.geom.Rectangle2D;
import com.samskivert.util.ObserverList;
import com.samskivert.util.StringUtil;
import static com.threerings.media.Log.log;
/**
* Something that can be rendered on the media panel.
*/
@@ -216,7 +218,7 @@ public abstract class AbstractMedia
if (_mgr != null) {
_mgr.queueNotification(_observers, amop);
} else {
Log.warning("Have no manager, dropping notification " +
log.warning("Have no manager, dropping notification " +
"[media=" + this + ", op=" + amop + "].");
}
}
@@ -32,6 +32,8 @@ import com.samskivert.util.ObserverList.ObserverOp;
import com.samskivert.util.ObserverList;
import com.samskivert.util.Tuple;
import static com.threerings.resource.Log.log;
/**
* Manages, ticks, and paints {@link AbstractMedia}.
*/
@@ -109,8 +111,7 @@ public abstract class AbstractMediaManager
}
} catch (Exception e) {
Log.warning("Failed to render media [media=" + media + ", e=" + e + "].");
Log.logStackTrace(e);
log.warning("Failed to render media [media=" + media + "].", e);
}
}
}
@@ -124,7 +125,7 @@ public abstract class AbstractMediaManager
public void fastForward (long timeDelta)
{
if (_tickStamp > 0) {
Log.warning("Egads! Asked to fastForward() during a tick.");
log.warning("Egads! Asked to fastForward() during a tick.");
Thread.dumpStack();
}
@@ -161,7 +162,7 @@ public abstract class AbstractMediaManager
public void renderOrderDidChange (AbstractMedia media)
{
if (_tickStamp > 0) {
Log.warning("Egads! Render order changed during a tick.");
log.warning("Egads! Render order changed during a tick.");
Thread.dumpStack();
}
@@ -189,7 +190,7 @@ public abstract class AbstractMediaManager
protected boolean insertMedia (AbstractMedia media)
{
if (_media.contains(media)) {
Log.warning("Attempt to insert media more than once [media=" + media + "].");
log.warning("Attempt to insert media more than once [media=" + media + "].");
Thread.dumpStack();
return false;
}
@@ -241,7 +242,7 @@ public abstract class AbstractMediaManager
}
return true;
}
Log.warning("Attempt to remove media that wasn't inserted [media=" + media + "].");
log.warning("Attempt to remove media that wasn't inserted [media=" + media + "].");
return false;
}
@@ -252,7 +253,7 @@ public abstract class AbstractMediaManager
protected void clearMedia ()
{
if (_tickStamp > 0) {
Log.warning("Egads! Requested to clearMedia() during a tick.");
log.warning("Egads! Requested to clearMedia() during a tick.");
Thread.dumpStack();
}
@@ -47,6 +47,8 @@ import com.samskivert.util.ListUtil;
import com.samskivert.util.RunAnywhere;
import com.samskivert.util.StringUtil;
import static com.threerings.media.Log.log;
/**
* Used to get Swing's repainting to jive with our active rendering strategy.
*
@@ -70,7 +72,7 @@ public class ActiveRepaintManager extends RepaintManager
{
Component vroot = null;
if (DEBUG) {
Log.info("Maybe invalidating " + toString(comp) + ".");
log.info("Maybe invalidating " + toString(comp) + ".");
}
// locate the validation root for this component
@@ -101,7 +103,7 @@ public class ActiveRepaintManager extends RepaintManager
// widget hierarchy
if (vroot == null) {
if (DEBUG) {
Log.info("Skipping vrootless component: " + toString(comp));
log.info("Skipping vrootless component: " + toString(comp));
}
return;
}
@@ -110,7 +112,7 @@ public class ActiveRepaintManager extends RepaintManager
// that is showing
if (getRoot(vroot) == null) {
if (DEBUG) {
Log.info("Skipping rootless component [comp=" + toString(comp) +
log.info("Skipping rootless component [comp=" + toString(comp) +
", vroot=" + toString(vroot) + "].");
}
return;
@@ -119,7 +121,7 @@ public class ActiveRepaintManager extends RepaintManager
// add the invalid component to our list and we'll validate it on the next frame
if (!ListUtil.containsRef(_invalid, vroot)) {
if (DEBUG) {
Log.info("Invalidating " + toString(vroot) + ".");
log.info("Invalidating " + toString(vroot) + ".");
}
_invalid = ListUtil.add(_invalid, vroot);
}
@@ -151,7 +153,7 @@ public class ActiveRepaintManager extends RepaintManager
}
if (DEBUG) {
Log.info("Dirtying component [comp=" + toString(comp) +
log.info("Dirtying component [comp=" + toString(comp) +
", drect=" + StringUtil.toString(new Rectangle(x, y, width, height)) + "].");
}
@@ -221,7 +223,7 @@ public class ActiveRepaintManager extends RepaintManager
for (int ii = 0; ii < icount; ii++) {
if (invalid[ii] != null) {
if (DEBUG) {
Log.info("Validating " + invalid[ii]);
log.info("Validating " + invalid[ii]);
}
((Component)invalid[ii]).validate();
}
@@ -275,7 +277,7 @@ public class ActiveRepaintManager extends RepaintManager
drect.y = y;
if (DEBUG) {
Log.info("Found dirty parent [comp=" + toString(comp) +
log.info("Found dirty parent [comp=" + toString(comp) +
", drect=" + StringUtil.toString(drect) +
", pcomp=" + toString(c) +
", prect=" + StringUtil.toString(prect) + "].");
@@ -283,7 +285,7 @@ public class ActiveRepaintManager extends RepaintManager
prect.add(drect);
if (DEBUG) {
Log.info("New prect " + StringUtil.toString(prect));
log.info("New prect " + StringUtil.toString(prect));
}
// remove the child component and be on our way
@@ -361,7 +363,7 @@ public class ActiveRepaintManager extends RepaintManager
// instance
if (root == _root) {
if (DEBUG) {
Log.info("Repainting [comp=" + toString(comp) + StringUtil.toString(_cbounds) +
log.info("Repainting [comp=" + toString(comp) + StringUtil.toString(_cbounds) +
", ocomp=" + toString(ocomp) +
", drect=" + StringUtil.toString(drect) + "].");
}
@@ -374,8 +376,7 @@ public class ActiveRepaintManager extends RepaintManager
ocomp.paint(g);
} catch (Exception e) {
Log.warning("Exception while painting component [comp=" + ocomp + "].");
Log.logStackTrace(e);
log.warning("Exception while painting component [comp=" + ocomp + "].", e);
}
g.translate(-_cbounds.x, -_cbounds.y);
@@ -385,7 +386,7 @@ public class ActiveRepaintManager extends RepaintManager
} else if (root != null) {
if (DEBUG) {
Log.info("Repainting old-school [comp=" + toString(comp) +
log.info("Repainting old-school [comp=" + toString(comp) +
", ocomp=" + toString(ocomp) + ", root=" + toString(root) +
", bounds=" + StringUtil.toString(_cbounds) + "].");
dumpHierarchy(comp);
@@ -431,7 +432,7 @@ public class ActiveRepaintManager extends RepaintManager
protected static void dumpHierarchy (Component comp)
{
for (String indent = ""; comp != null; indent += " ") {
Log.info(indent + toString(comp));
log.info(indent + toString(comp));
comp = comp.getParent();
}
}
@@ -27,6 +27,8 @@ import java.awt.GraphicsConfiguration;
import java.awt.Rectangle;
import java.awt.image.VolatileImage;
import static com.threerings.media.Log.log;
/**
* A {@link FrameManager} extension that uses a volatile off-screen image
* to do its rendering.
@@ -53,7 +55,7 @@ public class BackFrameManager extends FrameManager
// if we've changed resolutions, recreate the buffer
if (valres == VolatileImage.IMAGE_INCOMPATIBLE) {
Log.info("Back buffer incompatible, recreating.");
log.info("Back buffer incompatible, recreating.");
createBackBuffer(gc);
}
@@ -28,6 +28,8 @@ import java.awt.ImageCapabilities;
import java.awt.Rectangle;
import java.awt.image.BufferStrategy;
import static com.threerings.media.Log.log;
/**
* A {@link FrameManager} extension that uses a flip-buffer (via {@link
* BufferStrategy} to do its rendering.
@@ -45,7 +47,7 @@ public class FlipFrameManager extends FrameManager
try {
_window.createBufferStrategy(2, cap);
} catch (AWTException ae) {
Log.warning("Failed creating flip bufstrat: " + ae + ".");
log.warning("Failed creating flip bufstrat: " + ae + ".");
// fall back to one without custom capabilities
_window.createBufferStrategy(2);
}
@@ -62,7 +64,7 @@ public class FlipFrameManager extends FrameManager
// dirty everything if we're not incrementally rendering
if (!incremental) {
Log.info("Doing non-incremental render; contents lost " +
log.info("Doing non-incremental render; contents lost " +
"[lost=" + _bufstrat.contentsLost() +
", rest=" + _bufstrat.contentsRestored() + "].");
_root.getRootPane().revalidate();
+18 -18
View File
@@ -36,11 +36,15 @@ import com.samskivert.swing.RuntimeAdjust;
import com.samskivert.util.ListUtil;
import com.samskivert.util.RunAnywhere;
import com.samskivert.util.StringUtil;
import com.threerings.util.unsafe.Unsafe;
import com.threerings.media.timer.CalibratingTimer;
import com.threerings.media.timer.MediaTimer;
import com.threerings.media.timer.MillisTimer;
import com.threerings.media.util.TrailingAverage;
import com.threerings.util.unsafe.Unsafe;
import static com.threerings.media.Log.log;
/**
* Provides a central point from which the computation for each "frame" or tick can be dispatched.
@@ -132,7 +136,7 @@ public abstract class FrameManager
}
}
if (timer == null) {
Log.info("Can't use high performance timer, reverting to " +
log.info("Can't use high performance timer, reverting to " +
"System.currentTimeMillis() based timer.");
timer = new MillisTimer();
}
@@ -172,7 +176,7 @@ public abstract class FrameManager
{
Object[] nparts = ListUtil.testAndAddRef(_participants, participant);
if (nparts == null) {
Log.warning("Refusing to add duplicate frame participant! " + participant);
log.warning("Refusing to add duplicate frame participant! " + participant);
} else {
_participants = nparts;
}
@@ -395,7 +399,7 @@ public abstract class FrameManager
{
long gap = tickStamp - _lastTickStamp;
if (_lastTickStamp != 0 && gap > (HANG_DEBUG ? HANG_GAP : BIG_GAP)) {
Log.debug("Long tick delay [delay=" + gap + "ms].");
log.debug("Long tick delay [delay=" + gap + "ms].");
}
_lastTickStamp = tickStamp;
@@ -403,8 +407,7 @@ public abstract class FrameManager
try {
_repainter.validateComponents();
} catch (Throwable t) {
Log.warning("Failure validating components.");
Log.logStackTrace(t);
log.warning("Failure validating components.", t);
}
// tick all of our frame participants
@@ -425,15 +428,14 @@ public abstract class FrameManager
if (HANG_DEBUG) {
long delay = (System.currentTimeMillis() - start);
if (delay > HANG_GAP) {
Log.info("Whoa nelly! Ticker took a long time " +
log.info("Whoa nelly! Ticker took a long time " +
"[part=" + part + ", time=" + delay + "ms].");
}
}
} catch (Throwable t) {
Log.warning("Frame participant choked during tick " +
"[part=" + StringUtil.safeToString(part) + "].");
Log.logStackTrace(t);
log.warning("Frame participant choked during tick " +
"[part=" + StringUtil.safeToString(part) + "].", t);
}
}
@@ -506,8 +508,7 @@ public abstract class FrameManager
} catch (Throwable t) {
String ptos = StringUtil.safeToString(part);
Log.warning("Frame participant choked during paint [part=" + ptos + "].");
Log.logStackTrace(t);
log.warning("Frame participant choked during paint [part=" + ptos + "].", t);
}
// render any components in our layered pane that are not in the default layer
@@ -517,7 +518,7 @@ public abstract class FrameManager
if (HANG_DEBUG) {
long delay = (System.currentTimeMillis() - start);
if (delay > HANG_GAP) {
Log.warning("Whoa nelly! Painter took a long time " +
log.warning("Whoa nelly! Painter took a long time " +
"[part=" + part + ", time=" + delay + "ms].");
}
}
@@ -603,8 +604,7 @@ public abstract class FrameManager
try {
comp.paint(g);
} catch (Exception e) {
Log.warning("Component choked while rendering.");
Log.logStackTrace(e);
log.warning("Component choked while rendering.", e);
}
g.translate(-_tbounds.x, -_tbounds.y);
}
@@ -615,7 +615,7 @@ public abstract class FrameManager
{
public void run ()
{
Log.info("Frame manager ticker running " +
log.info("Frame manager ticker running " +
"[sleepGran=" + _sleepGranularity.getValue() + "].");
while (_running) {
long start = 0L;
@@ -629,14 +629,14 @@ public abstract class FrameManager
getPerfMetrics()[0].record((int)(woke-start)/100);
int elapsed = (int)(woke-start);
if (elapsed > _sleepGranularity.getValue()*1500) {
Log.warning("Long tick [elapsed=" + elapsed + "us].");
log.warning("Long tick [elapsed=" + elapsed + "us].");
}
}
// work around sketchy bug on WinXP that causes the clock to leap into the past
// from time to time
if (woke < _lastAttempt) {
Log.warning("Zoiks! We've leapt into the past, coping as best we can " +
log.warning("Zoiks! We've leapt into the past, coping as best we can " +
"[dt=" + (woke - _lastAttempt) + "].");
_lastAttempt = woke;
}
@@ -41,6 +41,8 @@ import com.threerings.media.tile.TileIcon;
import com.threerings.media.tile.TileManager;
import com.threerings.media.tile.TileSet;
import static com.threerings.media.Log.log;
/**
* Manages the creation of icons from tileset images. The icon manager is
* provided with a configuration file, which maps icon set identifiers to
@@ -149,7 +151,7 @@ public class IconManager
return new TileIcon(set.getTile(index));
} catch (Exception e) {
Log.warning("Unable to load icon [iconSet=" + iconSet +
log.warning("Unable to load icon [iconSet=" + iconSet +
", index=" + index + ", error=" + e + "].");
}
+2 -28
View File
@@ -21,39 +21,13 @@
package com.threerings.media;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.samskivert.util.Logger;
/**
* A placeholder class that contains a reference to the log object used by
* the media services package.
* Contains a reference to the log object used by the media services package.
*/
public class Log
{
/** We dispatch our log messages through this logger. */
public static Logger log = Logger.getLogger("com.threerings.media");
/** Convenience function. */
public static void debug (String message)
{
log.fine(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.log(Level.WARNING, t.getMessage(), t);
}
}
@@ -30,7 +30,7 @@ import java.awt.Window;
import javax.swing.JApplet;
import javax.swing.RepaintManager;
import com.threerings.media.Log;
import static com.threerings.media.Log.log;
/**
* When using the {@link FrameManager} in an Applet, one must use this
@@ -32,7 +32,7 @@ import javax.swing.JFrame;
import com.samskivert.util.StringUtil;
import com.threerings.media.Log;
import static com.threerings.media.Log.log;
/**
* When using the {@link FrameManager}, one must use this top-level frame
@@ -57,6 +57,8 @@ import com.threerings.media.sprite.action.CommandSprite;
import com.threerings.media.sprite.action.DisableableSprite;
import com.threerings.media.sprite.action.HoverSprite;
import static com.threerings.media.Log.log;
/**
* Provides a useful extensible framework for rendering animated displays that use sprites and
* animations. Sprites and animations can be added to this panel and they will automatically be
@@ -291,7 +293,7 @@ public class MediaPanel extends JComponent
public void setOpaque (boolean opaque)
{
if (!opaque) {
Log.warning("Media panels shouldn't be setOpaque(false).");
log.warning("Media panels shouldn't be setOpaque(false).");
Thread.dumpStack();
}
super.setOpaque(true);
@@ -346,8 +348,7 @@ public class MediaPanel extends JComponent
try {
paint(gfx, dirty);
} catch (Throwable t) {
Log.warning(this + " choked in paint(" + dirty + ").");
Log.logStackTrace(t);
log.warning(this + " choked in paint(" + dirty + ").", t);
}
// render our performance debugging if it's enabled
@@ -383,7 +384,7 @@ public class MediaPanel extends JComponent
Rectangle clip = dirty[ii];
// sanity-check the dirty rectangle
if (clip == null) {
Log.warning("Found null dirty rect painting media panel?!");
log.warning("Found null dirty rect painting media panel?!");
Thread.dumpStack();
continue;
}
@@ -38,6 +38,8 @@ import com.threerings.media.sprite.SpriteManager;
import com.threerings.media.animation.Animation;
import com.threerings.media.animation.AnimationManager;
import static com.threerings.media.Log.log;
/**
* Coordinates interaction between a sprite and animation manager and the media host that hosts and
* renders them. This class is a little fiddly because {@link MediaPanel} has been around a long
@@ -98,7 +100,7 @@ public class MetaMediaManager
{
// sanity check
if ((paused && (_pauseTime != 0)) || (!paused && (_pauseTime == 0))) {
Log.warning("Requested to pause when paused or vice-versa [paused=" + paused + "].");
log.warning("Requested to pause when paused or vice-versa [paused=" + paused + "].");
return;
}
@@ -23,11 +23,12 @@ package com.threerings.media;
import java.awt.EventQueue;
import java.awt.Rectangle;
import java.util.ArrayList;
import com.samskivert.util.StringUtil;
import static com.threerings.resource.Log.log;
/**
* Manages regions (rectangles) that are invalidated in the process of ticking animations and
* sprites and generally doing other display related business.
@@ -64,13 +65,13 @@ public class RegionManager
{
// make sure we're on an AWT thread
if (!EventQueue.isDispatchThread()) {
Log.warning("Oi! Region dirtied on non-AWT thread [rect=" + rect + "].");
log.warning("Oi! Region dirtied on non-AWT thread [rect=" + rect + "].");
Thread.dumpStack();
}
// sanity check
if (rect == null) {
Log.warning("Attempt to dirty a null rect!?");
log.warning("Attempt to dirty a null rect!?");
Thread.dumpStack();
return;
}
@@ -78,7 +79,7 @@ public class RegionManager
// more sanity checking
long x = rect.x, y = rect.y;
if ((Math.abs(x) > Integer.MAX_VALUE/2) || (Math.abs(y) > Integer.MAX_VALUE/2)) {
Log.warning("Requested to dirty questionable region " +
log.warning("Requested to dirty questionable region " +
"[rect=" + StringUtil.toString(rect) + "].");
return; // Let's not do it!
}
@@ -93,7 +94,7 @@ public class RegionManager
protected final boolean isValidSize (int width, int height)
{
if (width < 0 || height < 0) {
Log.warning("Attempt to add invalid dirty region?! " +
log.warning("Attempt to add invalid dirty region?! " +
"[size=" + width + "x" + height + "].");
Thread.dumpStack();
return false;
@@ -37,6 +37,8 @@ import com.threerings.media.image.Mirage;
import com.threerings.media.util.MathUtil;
import com.threerings.media.util.Pathable;
import static com.threerings.media.Log.log;
/**
* Extends the base media panel with the notion of a virtual coordinate
* system. All entities in the virtual media panel have virtual
@@ -236,7 +238,7 @@ public class VirtualMediaPanel extends MediaPanel
// determine how far we'll be moving on this tick
int dx = _nx - _vbounds.x, dy = _ny - _vbounds.y;
// Log.info("Scrolling into place [n=(" + _nx + ", " + _ny +
// log.info("Scrolling into place [n=(" + _nx + ", " + _ny +
// "), t=(" + _vbounds.x + ", " + _vbounds.y +
// "), d=(" + dx + ", " + dy +
// "), width=" + width + ", height=" + height + "].");
@@ -334,7 +336,7 @@ public class VirtualMediaPanel extends MediaPanel
break;
default:
Log.warning("Eh? Set to invalid pathable mode " +
log.warning("Eh? Set to invalid pathable mode " +
"[mode=" + _fmode + "].");
break;
}
@@ -27,7 +27,7 @@ import java.util.ArrayList;
import com.samskivert.swing.util.SwingUtil;
import com.threerings.media.Log;
import static com.threerings.media.Log.log;
/**
* A utility class for positioning animations such that they don't overlap,
@@ -61,7 +61,7 @@ public class AnimationArranger
protected AnimationAdapter _avoidAnimObs = new AnimationAdapter() {
public void animationCompleted (Animation anim, long when) {
if (!_avoidAnims.remove(anim)) {
Log.warning("Couldn't remove avoid animation?! " + anim + ".");
log.warning("Couldn't remove avoid animation?! " + anim + ".");
}
}
};
@@ -28,7 +28,7 @@ import java.util.ArrayList;
import com.samskivert.util.StringUtil;
import com.threerings.media.Log;
import static com.threerings.media.Log.log;
/**
* An animation that provides facilities for adding a sequence of
@@ -245,7 +245,7 @@ public class AnimationSequencer extends Animation
try {
_completionAction.run();
} catch (Throwable t) {
Log.logStackTrace(t);
log.warning(t);
}
}
@@ -26,9 +26,10 @@ import java.awt.Composite;
import java.awt.Graphics2D;
import java.awt.Rectangle;
import com.threerings.media.Log;
import com.threerings.media.effects.FadeEffect;
import static com.threerings.media.Log.log;
/**
* An animation that displays an image fading from one alpha level to
* another in specified increments over time. The animation is finished
@@ -29,7 +29,7 @@ import java.awt.RenderingHints;
import com.samskivert.swing.Label;
import com.samskivert.swing.util.SwingUtil;
import com.threerings.media.Log;
import static com.threerings.media.Log.log;
/**
* Does something extraordinary.
@@ -32,7 +32,7 @@ import com.samskivert.util.RandomUtil;
import com.threerings.media.animation.Animation;
import com.threerings.media.image.Mirage;
import com.threerings.media.Log;
import static com.threerings.media.Log.log;
/**
* Displays a set of spark images originating from a specified position
@@ -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.
@@ -32,7 +32,7 @@ import javax.sound.sampled.DataLine;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.SourceDataLine;
import com.threerings.media.Log;
import static com.threerings.media.Log.log;
/**
* Plays mp3 files. Depends on three external jar files that aren't even
@@ -69,7 +69,7 @@ public class Mp3Player extends MusicPlayer
inStream = AudioSystem.getAudioInputStream(
new BufferedInputStream(stream, BUFFER_SIZE));
} catch (Exception e) {
Log.warning("MP3 fuckola. [e=" + e + "].");
log.warning("MP3 fuckola. [e=" + e + "].");
return;
}
@@ -85,7 +85,7 @@ public class Mp3Player extends MusicPlayer
_line = (SourceDataLine) AudioSystem.getLine(info);
_line.open(format);
} catch (LineUnavailableException lue) {
Log.warning("MP3 line unavailable: " + lue);
log.warning("MP3 line unavailable: " + lue);
return;
}
@@ -97,7 +97,7 @@ public class Mp3Player extends MusicPlayer
try {
count = inStream.read(data, 0, data.length);
} catch (IOException ioe) {
Log.warning("Error reading MP3: " + ioe);
log.warning("Error reading MP3: " + ioe);
break;
}
if (count >= 0) {
@@ -28,7 +28,7 @@ import com.samskivert.util.Config;
import com.samskivert.util.RandomUtil;
import com.samskivert.util.RunQueue;
import com.threerings.media.Log;
import static com.threerings.media.Log.log;
/**
* Manages the playing of audio files.
@@ -164,7 +164,7 @@ public class MusicManager
}
}
Log.debug("Sequence stopped that wasn't in the stack anymore [key=" + mkey + "].");
log.debug("Sequence stopped that wasn't in the stack anymore [key=" + mkey + "].");
}
/**
@@ -188,7 +188,7 @@ public class MusicManager
Config c = _smgr.getConfig(info);
String[] names = c.getValue(info.key, (String[])null);
if ((names == null) || (names.length == 0)) {
Log.warning("No such music [key=" + info + "].");
log.warning("No such music [key=" + info + "].");
_musicStack.removeFirst();
playTopMusic();
return;
@@ -216,7 +216,7 @@ public class MusicManager
_musicPlayer.init(_playerListener);
} catch (Exception e) {
Log.warning("Unable to instantiate music player [class=" + playerClass +
log.warning("Unable to instantiate music player [class=" + playerClass +
", e=" + e + "].");
// scrap it, try again with the next song
@@ -235,7 +235,7 @@ public class MusicManager
// TODO: buffer for the music player?
_musicPlayer.start(_smgr._rmgr.getResource(bundle, music));
} catch (Exception e) {
Log.warning("Error playing music, skipping [e=" + e +
log.warning("Error playing music, skipping [e=" + e +
", bundle=" + bundle + ", music=" + music + "].");
_musicStack.removeFirst();
playTopMusic();
@@ -57,9 +57,10 @@ import com.samskivert.util.StringUtil;
import com.threerings.resource.ResourceManager;
import com.threerings.media.Log;
import com.threerings.media.MediaPrefs;
import static com.threerings.media.Log.log;
/**
* Manages the playing of audio files.
*/
@@ -363,11 +364,11 @@ public class SoundManager
boolean queued = enqueue(skey, true);
if (queued) {
if (_verbose.getValue()) {
Log.info("Sound request [key=" + skey.key + "].");
log.info("Sound request [key=" + skey.key + "].");
}
} else /* if (_verbose.getValue()) */ {
Log.warning("SoundManager not playing sound because too many sounds in queue " +
log.warning("SoundManager not playing sound because too many sounds in queue " +
"[key=" + skey + "].");
}
}
@@ -433,7 +434,7 @@ public class SoundManager
processKey(key);
} catch (Exception e) {
Log.logStackTrace(e);
log.warning(e);
}
}
}
@@ -516,7 +517,7 @@ public class SoundManager
} else if (key.isExpired()) {
if (_verbose.getValue()) {
Log.info("Sound expired [key=" + key.key + "].");
log.info("Sound expired [key=" + key.key + "].");
}
return;
@@ -563,7 +564,7 @@ public class SoundManager
} catch (IOException e) {
// this shouldn't ever ever happen because the stream
// we're given is from a reliable source
Log.warning("Error reading clip data! [e=" + e + "].");
log.warning("Error reading clip data! [e=" + e + "].");
return;
}
@@ -610,19 +611,19 @@ public class SoundManager
} catch (InterruptedException ie) { }
} catch (IOException ioe) {
Log.warning("Error loading sound file [key=" + key + ", e=" + ioe + "].");
log.warning("Error loading sound file [key=" + key + ", e=" + ioe + "].");
} catch (UnsupportedAudioFileException uafe) {
Log.warning("Unsupported sound format [key=" + key + ", e=" + uafe + "].");
log.warning("Unsupported sound format [key=" + key + ", e=" + uafe + "].");
} catch (LineUnavailableException lue) {
String err = "Line not available to play sound [key=" + key.key + ", e=" + lue + "].";
if (_soundSeemsToWork) {
Log.warning(err);
log.warning(err);
} else {
// this error comes every goddamned time we play a sound on someone with a
// misconfigured sound card, so let's just keep it to ourselves
Log.debug(err);
log.debug(err);
}
} finally {
@@ -676,7 +677,7 @@ public class SoundManager
Config c = getConfig(key);
String[] names = c.getValue(key.key, (String[])null);
if (names == null) {
Log.warning("No such sound [key=" + key + "].");
log.warning("No such sound [key=" + key + "].");
return null;
}
@@ -739,7 +740,7 @@ public class SoundManager
try {
return new FileInputStream(pick);
} catch (Exception e) {
Log.warning("Error reading test sound [e=" + e + ", file=" + pick + "].");
log.warning("Error reading test sound [e=" + e + ", file=" + pick + "].");
}
}
return null;
@@ -761,7 +762,7 @@ public class SoundManager
} catch (FileNotFoundException fnfe2) {
// only play the default sound if we have verbose sound debugging turned on.
if (_verbose.getValue()) {
Log.warning("Could not locate sound data [bundle=" + bundle +
log.warning("Could not locate sound data [bundle=" + bundle +
", path=" + path + "].");
if (_defaultClipPath != null) {
try {
@@ -770,14 +771,14 @@ public class SoundManager
try {
clipin = _rmgr.getResource(_defaultClipPath);
} catch (FileNotFoundException fnfe4) {
Log.warning("Additionally, the default " +
log.warning("Additionally, the default " +
"fallback sound could not be located " +
"[bundle=" + _defaultClipBundle +
", path=" + _defaultClipPath + "].");
}
}
} else {
Log.warning("No fallback default sound specified!");
log.warning("No fallback default sound specified!");
}
}
// if we couldn't load the default, rethrow
@@ -803,7 +804,7 @@ public class SoundManager
props = ConfigUtil.loadInheritedProperties(
propPath + ".properties", _rmgr.getClassLoader());
} catch (IOException ioe) {
Log.warning("Failed to load sound properties " +
log.warning("Failed to load sound properties " +
"[path=" + propPath + ", error=" + ioe + "].");
}
c = new Config(propPath, props);
@@ -865,7 +866,7 @@ public class SoundManager
FloatControl control = (FloatControl) line.getControl(FloatControl.Type.PAN);
control.setValue(pan);
} catch (Exception e) {
Log.debug("Cannot set pan on line: " + e);
log.debug("Cannot set pan on line: " + e);
}
}
@@ -32,7 +32,7 @@ import com.threerings.media.AbstractMedia;
import com.threerings.media.util.Path;
import com.threerings.media.util.Pathable;
import com.threerings.media.Log;
import static com.threerings.media.Log.log;
/**
* The sprite class represents a single moveable object in an animated
@@ -27,11 +27,12 @@ import java.io.IOException;
import com.samskivert.util.LRUHashMap;
import com.threerings.media.Log;
import com.threerings.media.image.BufferedMirage;
import com.threerings.media.image.Colorization;
import com.threerings.media.image.Mirage;
import static com.threerings.media.Log.log;
/**
* An image provider that can be used by command line tools to load images and provide them to
* tilesets when doing things like preprocessing tileset images.
@@ -47,7 +48,7 @@ public abstract class SimpleCachingImageProvider implements ImageProvider
image = loadImage(path);
_cache.put(path, image);
} catch (IOException ioe) {
Log.warning("Failed to load image [path=" + path + ", ioe=" + ioe + "].");
log.warning("Failed to load image [path=" + path + ", ioe=" + ioe + "].");
}
}
return image;
@@ -27,9 +27,10 @@ import java.util.HashMap;
import com.samskivert.io.PersistenceException;
import com.threerings.media.Log;
import com.threerings.media.image.ImageManager;
import static com.threerings.media.Log.log;
/**
* The tile manager provides a simplified interface for retrieving and
* caching tiles. Tiles can be loaded in two different ways. An
@@ -170,7 +171,7 @@ public class TileManager
try {
return _setrep.getTileSet(tileSetId);
} catch (PersistenceException pe) {
Log.warning("Failure loading tileset [id=" + tileSetId +
log.warning("Failure loading tileset [id=" + tileSetId +
", error=" + pe + "].");
throw new NoSuchTileSetException(tileSetId);
}
@@ -193,7 +194,7 @@ public class TileManager
try {
return _setrep.getTileSet(name);
} catch (PersistenceException pe) {
Log.warning("Failure loading tileset [name=" + name +
log.warning("Failure loading tileset [name=" + name +
", error=" + pe + "].");
throw new NoSuchTileSetException(name);
}
@@ -31,7 +31,6 @@ import java.util.Iterator;
import com.samskivert.util.StringUtil;
import com.samskivert.util.Throttle;
import com.threerings.media.Log;
import com.threerings.media.image.Colorization;
import com.threerings.media.image.Mirage;
import com.threerings.media.image.ImageUtil;
@@ -39,6 +38,8 @@ import com.threerings.media.image.BufferedMirage;
import com.threerings.media.util.MultiFrameImage;
import com.threerings.media.util.MultiFrameImageImpl;
import static com.threerings.media.Log.log;
/**
* A tileset stores information on a single logical set of tiles. It provides a clean interface for
* the {@link TileManager} or other entities to retrieve individual tiles from the tile set and
@@ -126,7 +127,7 @@ public abstract class TileSet
return tset;
} catch (CloneNotSupportedException cnse) {
Log.warning("Unable to clone tileset prior to colorization [tset=" + this +
log.warning("Unable to clone tileset prior to colorization [tset=" + this +
", zations=" + StringUtil.toString(zations) + ", error=" + cnse + "].");
return null;
}
@@ -252,7 +253,7 @@ public abstract class TileSet
Mirage mirage = null;
if (checkTileIndex(tileIndex)) {
if (_improv == null) {
Log.warning("Aiya! Tile set missing image provider [path=" + _imagePath + "].");
log.warning("Aiya! Tile set missing image provider [path=" + _imagePath + "].");
} else {
mirage = _improv.getTileImage(_imagePath, bounds, zations);
}
@@ -289,7 +290,7 @@ public abstract class TileSet
if (timg != null) {
img = timg.getSubimage(bounds.x, bounds.y, bounds.width, bounds.height);
} else {
Log.warning("Missing source image " + this);
log.warning("Missing source image " + this);
}
}
if (img == null) {
@@ -318,7 +319,7 @@ public abstract class TileSet
if (tileIndex >= 0 && tileIndex < tcount) {
return true;
} else {
Log.warning("Requested invalid tile [tset=" + this + ", index=" + tileIndex + "].");
log.warning("Requested invalid tile [tset=" + this + ", index=" + tileIndex + "].");
Thread.dumpStack();
return false;
}
@@ -386,7 +387,7 @@ public abstract class TileSet
}
}
}
Log.info("Tile caches [amem=" + (amem / 1024) + "k" +
log.info("Tile caches [amem=" + (amem / 1024) + "k" +
", tmem=" + (Tile._totalTileMemory / 1024) + "k" +
", seen=" + _atiles.size() + ", asize=" + asize + "].");
}
@@ -29,13 +29,14 @@ import com.samskivert.util.HashIntMap;
import com.threerings.resource.ResourceBundle;
import com.threerings.resource.ResourceManager;
import com.threerings.media.Log;
import com.threerings.media.image.ImageManager;
import com.threerings.media.tile.IMImageProvider;
import com.threerings.media.tile.NoSuchTileSetException;
import com.threerings.media.tile.TileSet;
import com.threerings.media.tile.TileSetRepository;
import static com.threerings.media.Log.log;
/**
* Loads tileset data from a set of resource bundles.
*
@@ -81,7 +82,7 @@ public class BundledTileSetRepository
// sanity check
if (rbundles == null) {
Log.warning("Unable to fetch tileset resource set " +
log.warning("Unable to fetch tileset resource set " +
"[name=" + name + "]. Perhaps it's not defined " +
"in the resource manager config?");
return;
@@ -127,11 +128,8 @@ public class BundledTileSetRepository
addBundle(idmap, namemap, tsb);
} catch (Exception e) {
Log.warning("Unable to load tileset bundle '" +
BundleUtil.METADATA_PATH + "' from resource " +
"bundle [rbundle=" + bundle +
", error=" + e + "].");
Log.logStackTrace(e);
log.warning("Unable to load tileset bundle '" + BundleUtil.METADATA_PATH +
"' from resource bundle [rbundle=" + bundle + "].", e);
}
}
@@ -216,7 +214,7 @@ public class BundledTileSetRepository
try {
wait();
} catch (InterruptedException ie) {
Log.warning("Interrupted waiting for bundles " + ie);
log.warning("Interrupted waiting for bundles " + ie);
}
}
}
@@ -35,7 +35,6 @@ import javax.imageio.ImageIO;
import org.apache.commons.io.IOUtils;
import com.threerings.media.Log;
import com.threerings.util.FileUtil;
import com.threerings.media.tile.ImageProvider;
import com.threerings.media.tile.ObjectTileSet;
@@ -44,6 +43,8 @@ import com.threerings.media.tile.TrimmedObjectTileSet;
import com.threerings.media.tile.bundle.BundleUtil;
import com.threerings.media.tile.bundle.TileSetBundle;
import static com.threerings.media.Log.log;
public class DirectoryTileSetBundler extends TileSetBundler
{
public DirectoryTileSetBundler (File configFile)
@@ -74,7 +75,7 @@ public class DirectoryTileSetBundler extends TileSetBundler
// sanity checks
if (imagePath == null) {
Log.warning("Tileset contains no image path " +
log.warning("Tileset contains no image path " +
"[set=" + set + "]. It ain't gonna work.");
continue;
}
@@ -42,7 +42,6 @@ import org.xml.sax.SAXException;
import com.samskivert.io.PersistenceException;
import com.samskivert.util.HashIntMap;
import com.threerings.media.Log;
import com.threerings.media.tile.ImageProvider;
import com.threerings.media.tile.ObjectTileSet;
import com.threerings.media.tile.SimpleCachingImageProvider;
@@ -54,6 +53,8 @@ import com.threerings.media.tile.bundle.TileSetBundle;
import com.threerings.media.tile.tools.xml.TileSetRuleSet;
import com.threerings.resource.FastImageIO;
import static com.threerings.media.Log.log;
/**
* The tileset bundler is used to create tileset bundles from a set of XML
* tileset descriptions in a bundle description file. The bundles contain
@@ -259,7 +260,7 @@ public class TileSetBundler
// let's be robust
if (name == null) {
Log.warning("Tileset was parsed, but received no name " +
log.warning("Tileset was parsed, but received no name " +
"[set=" + set + "]. Skipping.");
continue;
}
@@ -299,7 +300,7 @@ public class TileSetBundler
try {
idBroker.commit();
} catch (PersistenceException pe) {
Log.warning("Failure committing brokered tileset ids " +
log.warning("Failure committing brokered tileset ids " +
"back to broker's persistent store " +
"[error=" + pe + "].");
}
@@ -373,7 +374,7 @@ public class TileSetBundler
// sanity checks
if (imagePath == null) {
Log.warning("Tileset contains no image path " +
log.warning("Tileset contains no image path " +
"[set=" + set + "]. It ain't gonna work.");
continue;
}
@@ -450,7 +451,7 @@ public class TileSetBundler
// remove the incomplete jar file and rethrow the exception
jar.close();
if (!target.delete()) {
Log.warning("Failed to close botched bundle '" + target + "'.");
log.warning("Failed to close botched bundle '" + target + "'.");
}
String errmsg = "Failed to create bundle " + target + ": " + e;
throw (IOException) new IOException(errmsg).initCause(e);
@@ -29,9 +29,10 @@ import org.apache.commons.digester.Digester;
import com.samskivert.util.StringUtil;
import com.samskivert.xml.CallMethodSpecialRule;
import com.threerings.media.Log;
import com.threerings.media.tile.SwissArmyTileSet;
import static com.threerings.media.Log.log;
/**
* Parses {@link SwissArmyTileSet} instances from a tileset description. A
* swiss army tileset description looks like so:
@@ -96,7 +97,7 @@ public class SwissArmyTileSetRuleSet extends TileSetRuleSet
if (values.length == 2) {
starget.setOffsetPos(new Point(values[0], values[1]));
} else {
Log.warning("Invalid 'offsetPos' definition '" +
log.warning("Invalid 'offsetPos' definition '" +
bodyText + "'.");
}
}
@@ -111,7 +112,7 @@ public class SwissArmyTileSetRuleSet extends TileSetRuleSet
if (values.length == 2) {
starget.setGapSize(new Dimension(values[0], values[1]));
} else {
Log.warning("Invalid 'gapSize' definition '" +
log.warning("Invalid 'gapSize' definition '" +
bodyText + "'.");
}
}
@@ -126,21 +127,21 @@ public class SwissArmyTileSetRuleSet extends TileSetRuleSet
// check for a <widths> element
if (set.getWidths() == null) {
Log.warning("Tile set definition missing valid <widths> " +
log.warning("Tile set definition missing valid <widths> " +
"element [set=" + set + "].");
valid = false;
}
// check for a <heights> element
if (set.getHeights() == null) {
Log.warning("Tile set definition missing valid <heights> " +
log.warning("Tile set definition missing valid <heights> " +
"element [set=" + set + "].");
valid = false;
}
// check for a <tileCounts> element
if (set.getTileCounts() == null) {
Log.warning("Tile set definition missing valid <tileCounts> " +
log.warning("Tile set definition missing valid <tileCounts> " +
"element [set=" + set + "].");
valid = false;
}
@@ -28,9 +28,10 @@ import com.samskivert.util.StringUtil;
import com.samskivert.xml.ValidatedSetNextRule.Validator;
import com.samskivert.xml.ValidatedSetNextRule;
import com.threerings.media.Log;
import com.threerings.media.tile.TileSet;
import static com.threerings.media.Log.log;
/**
* The tileset rule set is used to parse the base attributes of a tileset
* instance. Derived classes would extend this and add rules for their own
@@ -106,14 +107,14 @@ public abstract class TileSetRuleSet
// check for the 'name' attribute
if (StringUtil.isBlank(set.getName())) {
Log.warning("Tile set definition missing 'name' attribute " +
log.warning("Tile set definition missing 'name' attribute " +
"[set=" + set + "].");
valid = false;
}
// check for an <imagePath> element
if (StringUtil.isBlank(set.getImagePath())) {
Log.warning("Tile set definition missing <imagePath> element " +
log.warning("Tile set definition missing <imagePath> element " +
"[set=" + set + "].");
valid = false;
}
@@ -23,9 +23,10 @@ package com.threerings.media.tile.tools.xml;
import org.apache.commons.digester.Digester;
import com.threerings.media.Log;
import com.threerings.media.tile.UniformTileSet;
import static com.threerings.media.Log.log;
/**
* Parses {@link UniformTileSet} instances from a tileset description. A
* uniform tileset description looks like so:
@@ -69,14 +70,14 @@ public class UniformTileSetRuleSet extends TileSetRuleSet
// check for a <width> element
if (set.getWidth() == 0) {
Log.warning("Tile set definition missing valid <width> " +
log.warning("Tile set definition missing valid <width> " +
"element [set=" + set + "].");
valid = false;
}
// check for a <height> element
if (set.getHeight() == 0) {
Log.warning("Tile set definition missing valid <height> " +
log.warning("Tile set definition missing valid <height> " +
"element [set=" + set + "].");
valid = false;
}
@@ -35,9 +35,10 @@ import org.xml.sax.SAXException;
import com.samskivert.util.ConfigUtil;
import com.samskivert.xml.ValidatedSetNextRule;
import com.threerings.media.Log;
import com.threerings.media.tile.TileSet;
import static com.threerings.media.Log.log;
/**
* Parse an XML tileset description file and construct tileset objects for
* each valid description. Does not currently perform validation on the
@@ -147,16 +148,14 @@ public class XMLTileSetParser
try {
_digester.parse(source);
} catch (SAXException saxe) {
Log.warning("Exception parsing tile set descriptions " +
"[error=" + saxe + "].");
Log.logStackTrace(saxe);
log.warning("Exception parsing tile set descriptions.", saxe);
}
// stick the tilesets from the list into the hashtable
for (int i = 0; i < setlist.size(); i++) {
TileSet set = (TileSet)setlist.get(i);
if (set.getName() == null) {
Log.warning("Tileset did not receive name during " +
log.warning("Tileset did not receive name during " +
"parsing process [set=" + set + "].");
} else {
tilesets.put(set.getName(), set);
@@ -24,7 +24,7 @@ package com.threerings.media.util;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import com.threerings.media.Log;
import static com.threerings.media.Log.log;
/**
* Used to tile a background image into regions of various sizes. The
@@ -41,7 +41,7 @@ public class BackgroundTiler
{
// make sure we were given the goods
if (src == null) {
Log.info("Backgrounder given null source image. Coping.");
log.info("Backgrounder given null source image. Coping.");
return;
}
@@ -56,7 +56,7 @@ public class BackgroundTiler
// make sure the image suits our minimum useful dimensions
if (_w3 <= 0 || _cw3 <= 0 || _h3 <= 0 || _ch3 <= 0) {
Log.warning("Backgrounder given source image of insufficient " +
log.warning("Backgrounder given source image of insufficient " +
"size for tiling " +
"[width=" + width + ", height=" + height + "].");
return;
@@ -26,7 +26,7 @@ import java.awt.Graphics2D;
import com.samskivert.util.RandomUtil;
import com.threerings.media.Log;
import static com.threerings.media.Log.log;
/**
* Bobble a Pathable.
@@ -34,9 +34,10 @@ import com.samskivert.util.StringUtil;
import com.threerings.util.DirectionCodes;
import com.threerings.util.DirectionUtil;
import com.threerings.media.Log;
import com.threerings.media.util.MathUtil;
import static com.threerings.media.Log.log;
/**
* The line segment path is used to cause a pathable to follow a path that
* is made up of a sequence of line segments. There must be at least two
@@ -160,7 +161,7 @@ public class LineSegmentPath
// information to compute our velocity
int ncount = _nodes.size();
if (ncount < 2) {
Log.warning("Requested to set duration of bogus path " +
log.warning("Requested to set duration of bogus path " +
"[path=" + this + ", duration=" + millis + "].");
return;
}
@@ -26,7 +26,7 @@ import java.awt.Graphics2D;
import java.util.ArrayList;
import java.util.List;
import com.threerings.media.Log;
import static com.threerings.media.Log.log;
/**
* Used to create a path that is a sequence of several other paths.
@@ -81,7 +81,7 @@ public class PathSequence
public boolean tick (Pathable pable, long tickStamp)
{
if (pable != _pable) {
Log.warning("PathSequence ticked with different path than " +
log.warning("PathSequence ticked with different path than " +
"it was inited with.");
}
return _curPath.tick(_pableRep, tickStamp);
@@ -23,10 +23,11 @@ package com.threerings.media.util;
import java.util.HashMap;
import com.threerings.media.Log;
import com.threerings.media.timer.MediaTimer;
import com.threerings.media.timer.NanoTimer;
import static com.threerings.media.Log.log;
/**
* Provides a simple mechanism for monitoring the number of times an action takes place within a
* certain time period.
@@ -78,7 +79,7 @@ public class PerformanceMonitor
// get the observer's action hashtable
HashMap actions = (HashMap)_observers.get(obs);
if (actions == null) {
Log.warning("Attempt to unregister by unknown observer " +
log.warning("Attempt to unregister by unknown observer " +
"[observer=" + obs + ", name=" + name + "].");
return;
}
@@ -86,7 +87,7 @@ public class PerformanceMonitor
// attempt to remove the specified action
PerformanceAction action = (PerformanceAction)actions.remove(name);
if (action == null) {
Log.warning("Attempt to unregister unknown action " +
log.warning("Attempt to unregister unknown action " +
"[observer=" + obs + ", name=" + name + "].");
return;
}
@@ -109,7 +110,7 @@ public class PerformanceMonitor
// get the observer's action hashtable
HashMap actions = (HashMap)_observers.get(obs);
if (actions == null) {
Log.warning("Attempt to tick by unknown observer " +
log.warning("Attempt to tick by unknown observer " +
"[observer=" + obs + ", name=" + name + "].");
return;
}
@@ -117,7 +118,7 @@ public class PerformanceMonitor
// get the specified action
PerformanceAction action = (PerformanceAction)actions.get(name);
if (action == null) {
Log.warning("Attempt to tick unknown value " +
log.warning("Attempt to tick unknown value " +
"[observer=" + obs + ", name=" + name + "].");
return;
}
@@ -21,7 +21,7 @@
package com.threerings.media.util;
import com.threerings.media.Log;
import static com.threerings.media.Log.log;
/**
* A base class for path implementations that endeavor to move their
@@ -37,7 +37,7 @@ public abstract class TimedPath implements Path
{
// sanity check some things
if (duration <= 0) {
Log.warning("Requested path with illegal duration (<=0) " +
log.warning("Requested path with illegal duration (<=0) " +
"[duration=" + duration + "]");
Thread.dumpStack();
duration = 1; // assume something short but non-zero