From 376f5e680a9b4c9922042164d0a9208dd976b16d Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Tue, 13 Nov 2007 09:30:23 +0000 Subject: [PATCH] Sorry, Log, no more free ride for you. Putting you at the top level screws up use of another Log class. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4874 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../crowd/chat/client/ChatDirector.as | 1 + .../crowd/chat/client/CurseFilter.as | 1 + .../crowd/client/LocationDirector.as | 1 + .../threerings/crowd/client/PlaceViewUtil.as | 2 ++ src/as/com/threerings/io/FrameReader.as | 2 ++ src/as/com/threerings/io/ObjectInputStream.as | 1 + .../com/threerings/io/ObjectOutputStream.as | 1 + .../threerings/io/streamers/ArrayStreamer.as | 1 + .../com/threerings/presents/client/Client.as | 1 + .../presents/client/ClientDObjectMgr.as | 1 + .../presents/client/Communicator.as | 1 + .../presents/client/InvocationDecoder.as | 2 ++ .../presents/client/InvocationDirector.as | 1 + .../presents/client/ServerSwitcher.as | 1 + ...InvocationMarshaller_ListenerMarshaller.as | 1 + .../com/threerings/presents/dobj/DObject.as | 1 + src/as/com/threerings/presents/dobj/DSet.as | 1 + .../presents/dobj/EntryAddedEvent.as | 1 + .../presents/dobj/EntryRemovedEvent.as | 1 + .../presents/dobj/EntryUpdatedEvent.as | 1 + .../threerings/presents/net/BootstrapData.as | 1 + .../presents/util/SafeSubscriber.as | 2 ++ src/as/{ => com/threerings/util}/Log.as | 19 +------------------ src/as/com/threerings/util/LogTarget.as | 4 +--- 24 files changed, 28 insertions(+), 21 deletions(-) rename src/as/{ => com/threerings/util}/Log.as (84%) diff --git a/src/as/com/threerings/crowd/chat/client/ChatDirector.as b/src/as/com/threerings/crowd/chat/client/ChatDirector.as index 7b1b39c62..9874284e0 100644 --- a/src/as/com/threerings/crowd/chat/client/ChatDirector.as +++ b/src/as/com/threerings/crowd/chat/client/ChatDirector.as @@ -23,6 +23,7 @@ package com.threerings.crowd.chat.client { import com.threerings.util.ArrayUtil; import com.threerings.util.HashMap; +import com.threerings.util.Log; import com.threerings.util.Map; import com.threerings.util.ObserverList; import com.threerings.util.ResultListener; diff --git a/src/as/com/threerings/crowd/chat/client/CurseFilter.as b/src/as/com/threerings/crowd/chat/client/CurseFilter.as index cf3f959d4..5021bae08 100644 --- a/src/as/com/threerings/crowd/chat/client/CurseFilter.as +++ b/src/as/com/threerings/crowd/chat/client/CurseFilter.as @@ -21,6 +21,7 @@ package com.threerings.crowd.chat.client { +import com.threerings.util.Log; import com.threerings.util.Name; import com.threerings.util.StringUtil; diff --git a/src/as/com/threerings/crowd/client/LocationDirector.as b/src/as/com/threerings/crowd/client/LocationDirector.as index e37895f62..703ea4ce8 100644 --- a/src/as/com/threerings/crowd/client/LocationDirector.as +++ b/src/as/com/threerings/crowd/client/LocationDirector.as @@ -24,6 +24,7 @@ package com.threerings.crowd.client { import flash.utils.getTimer; // function import import com.threerings.util.ObserverList; +import com.threerings.util.Log; import com.threerings.util.ResultListener; import com.threerings.presents.client.BasicDirector; diff --git a/src/as/com/threerings/crowd/client/PlaceViewUtil.as b/src/as/com/threerings/crowd/client/PlaceViewUtil.as index 3274e745e..cf07c9327 100644 --- a/src/as/com/threerings/crowd/client/PlaceViewUtil.as +++ b/src/as/com/threerings/crowd/client/PlaceViewUtil.as @@ -26,6 +26,8 @@ import flash.display.DisplayObjectContainer; import mx.core.IRawChildrenContainer; // a simple interface from flex +import com.threerings.util.Log; + import com.threerings.crowd.data.PlaceObject; /** diff --git a/src/as/com/threerings/io/FrameReader.as b/src/as/com/threerings/io/FrameReader.as index d948e2178..cd309793f 100644 --- a/src/as/com/threerings/io/FrameReader.as +++ b/src/as/com/threerings/io/FrameReader.as @@ -29,6 +29,8 @@ import flash.net.Socket; import flash.utils.ByteArray; import flash.utils.Endian; +import com.threerings.util.Log; + /** * Reads socket data until a complete frame is available. * This dispatches a FrameAvailableEvent.FRAME_AVAILABLE once a frame diff --git a/src/as/com/threerings/io/ObjectInputStream.as b/src/as/com/threerings/io/ObjectInputStream.as index 818b69c36..f50314503 100644 --- a/src/as/com/threerings/io/ObjectInputStream.as +++ b/src/as/com/threerings/io/ObjectInputStream.as @@ -28,6 +28,7 @@ import flash.utils.ByteArray; import flash.utils.IDataInput; import com.threerings.util.ClassUtil; +import com.threerings.util.Log; public class ObjectInputStream { diff --git a/src/as/com/threerings/io/ObjectOutputStream.as b/src/as/com/threerings/io/ObjectOutputStream.as index d7b47f93e..94110cf16 100644 --- a/src/as/com/threerings/io/ObjectOutputStream.as +++ b/src/as/com/threerings/io/ObjectOutputStream.as @@ -26,6 +26,7 @@ import flash.utils.IDataOutput; import com.threerings.util.ClassUtil; import com.threerings.util.HashMap; +import com.threerings.util.Log; import com.threerings.util.Short; public class ObjectOutputStream diff --git a/src/as/com/threerings/io/streamers/ArrayStreamer.as b/src/as/com/threerings/io/streamers/ArrayStreamer.as index 52f2d8512..962b365ec 100644 --- a/src/as/com/threerings/io/streamers/ArrayStreamer.as +++ b/src/as/com/threerings/io/streamers/ArrayStreamer.as @@ -22,6 +22,7 @@ package com.threerings.io.streamers { import com.threerings.util.ClassUtil; +import com.threerings.util.Log; import com.threerings.io.ArrayMask; import com.threerings.io.ObjectInputStream; diff --git a/src/as/com/threerings/presents/client/Client.as b/src/as/com/threerings/presents/client/Client.as index 10376e322..259352c31 100644 --- a/src/as/com/threerings/presents/client/Client.as +++ b/src/as/com/threerings/presents/client/Client.as @@ -28,6 +28,7 @@ import flash.events.TimerEvent; import flash.utils.Timer; +import com.threerings.util.Log; import com.threerings.util.MethodQueue; import com.threerings.util.ObserverList; diff --git a/src/as/com/threerings/presents/client/ClientDObjectMgr.as b/src/as/com/threerings/presents/client/ClientDObjectMgr.as index 434f4dc11..aaefa01a3 100644 --- a/src/as/com/threerings/presents/client/ClientDObjectMgr.as +++ b/src/as/com/threerings/presents/client/ClientDObjectMgr.as @@ -28,6 +28,7 @@ import flash.utils.getTimer; // function import import com.threerings.util.ClassUtil; import com.threerings.util.HashMap; +import com.threerings.util.Log; import com.threerings.presents.dobj.CompoundEvent; import com.threerings.presents.dobj.DEvent; diff --git a/src/as/com/threerings/presents/client/Communicator.as b/src/as/com/threerings/presents/client/Communicator.as index ff56324ef..566c96e86 100644 --- a/src/as/com/threerings/presents/client/Communicator.as +++ b/src/as/com/threerings/presents/client/Communicator.as @@ -31,6 +31,7 @@ import flash.net.Socket; import flash.utils.ByteArray; import flash.utils.Endian; +import com.threerings.util.Log; import com.threerings.util.StringUtil; import com.threerings.io.FrameAvailableEvent; diff --git a/src/as/com/threerings/presents/client/InvocationDecoder.as b/src/as/com/threerings/presents/client/InvocationDecoder.as index cc0ad8fa7..24caf9c03 100644 --- a/src/as/com/threerings/presents/client/InvocationDecoder.as +++ b/src/as/com/threerings/presents/client/InvocationDecoder.as @@ -21,6 +21,8 @@ package com.threerings.presents.client { +import com.threerings.util.Log; + /** * Provides the basic functionality used to dispatch invocation * notification events. diff --git a/src/as/com/threerings/presents/client/InvocationDirector.as b/src/as/com/threerings/presents/client/InvocationDirector.as index 199d01cc8..8bdd21de8 100644 --- a/src/as/com/threerings/presents/client/InvocationDirector.as +++ b/src/as/com/threerings/presents/client/InvocationDirector.as @@ -25,6 +25,7 @@ import flash.errors.IllegalOperationError; import flash.utils.getTimer; // function import import com.threerings.util.HashMap; +import com.threerings.util.Log; import com.threerings.util.Wrapped; import com.threerings.presents.data.InvocationMarshaller_ListenerMarshaller; diff --git a/src/as/com/threerings/presents/client/ServerSwitcher.as b/src/as/com/threerings/presents/client/ServerSwitcher.as index ed88b4414..683e96b7c 100644 --- a/src/as/com/threerings/presents/client/ServerSwitcher.as +++ b/src/as/com/threerings/presents/client/ServerSwitcher.as @@ -21,6 +21,7 @@ package com.threerings.presents.client { +import com.threerings.util.Log; import com.threerings.util.StringUtil; import com.threerings.presents.data.AuthCodes; diff --git a/src/as/com/threerings/presents/data/InvocationMarshaller_ListenerMarshaller.as b/src/as/com/threerings/presents/data/InvocationMarshaller_ListenerMarshaller.as index 501a4b3e7..2e2cf0c9b 100644 --- a/src/as/com/threerings/presents/data/InvocationMarshaller_ListenerMarshaller.as +++ b/src/as/com/threerings/presents/data/InvocationMarshaller_ListenerMarshaller.as @@ -22,6 +22,7 @@ package com.threerings.presents.data { import com.threerings.util.ClassUtil; +import com.threerings.util.Log; import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; diff --git a/src/as/com/threerings/presents/dobj/DObject.as b/src/as/com/threerings/presents/dobj/DObject.as index c906eeeab..e8264a3f6 100644 --- a/src/as/com/threerings/presents/dobj/DObject.as +++ b/src/as/com/threerings/presents/dobj/DObject.as @@ -26,6 +26,7 @@ import flash.errors.IllegalOperationError; import flash.events.EventDispatcher; import com.threerings.util.ClassUtil; +import com.threerings.util.Log; import com.threerings.util.StringBuilder; import com.threerings.io.ObjectInputStream; diff --git a/src/as/com/threerings/presents/dobj/DSet.as b/src/as/com/threerings/presents/dobj/DSet.as index c521cf59e..036d80ec4 100644 --- a/src/as/com/threerings/presents/dobj/DSet.as +++ b/src/as/com/threerings/presents/dobj/DSet.as @@ -25,6 +25,7 @@ import com.threerings.util.ArrayIterator; import com.threerings.util.Cloneable; import com.threerings.util.Equalable; import com.threerings.util.Iterator; +import com.threerings.util.Log; import com.threerings.util.StringBuilder; import com.threerings.util.Util; diff --git a/src/as/com/threerings/presents/dobj/EntryAddedEvent.as b/src/as/com/threerings/presents/dobj/EntryAddedEvent.as index 76b60c7bf..f2edec189 100644 --- a/src/as/com/threerings/presents/dobj/EntryAddedEvent.as +++ b/src/as/com/threerings/presents/dobj/EntryAddedEvent.as @@ -24,6 +24,7 @@ package com.threerings.presents.dobj { import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; +import com.threerings.util.Log; import com.threerings.util.StringBuilder; /** diff --git a/src/as/com/threerings/presents/dobj/EntryRemovedEvent.as b/src/as/com/threerings/presents/dobj/EntryRemovedEvent.as index 4901740be..0dcb5a655 100644 --- a/src/as/com/threerings/presents/dobj/EntryRemovedEvent.as +++ b/src/as/com/threerings/presents/dobj/EntryRemovedEvent.as @@ -24,6 +24,7 @@ package com.threerings.presents.dobj { import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; +import com.threerings.util.Log; import com.threerings.util.StringBuilder; import com.threerings.util.Wrapped; diff --git a/src/as/com/threerings/presents/dobj/EntryUpdatedEvent.as b/src/as/com/threerings/presents/dobj/EntryUpdatedEvent.as index b1d311342..746f1d18d 100644 --- a/src/as/com/threerings/presents/dobj/EntryUpdatedEvent.as +++ b/src/as/com/threerings/presents/dobj/EntryUpdatedEvent.as @@ -24,6 +24,7 @@ package com.threerings.presents.dobj { import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; +import com.threerings.util.Log; import com.threerings.util.StringBuilder; /** diff --git a/src/as/com/threerings/presents/net/BootstrapData.as b/src/as/com/threerings/presents/net/BootstrapData.as index 22f4d6b2b..8f50adb54 100644 --- a/src/as/com/threerings/presents/net/BootstrapData.as +++ b/src/as/com/threerings/presents/net/BootstrapData.as @@ -25,6 +25,7 @@ import com.threerings.io.ObjectInputStream; import com.threerings.io.ObjectOutputStream; import com.threerings.io.Streamable; +import com.threerings.util.Log; import com.threerings.util.StreamableArrayList; /** diff --git a/src/as/com/threerings/presents/util/SafeSubscriber.as b/src/as/com/threerings/presents/util/SafeSubscriber.as index 553fac087..10ef4597b 100644 --- a/src/as/com/threerings/presents/util/SafeSubscriber.as +++ b/src/as/com/threerings/presents/util/SafeSubscriber.as @@ -21,6 +21,8 @@ package com.threerings.presents.util { +import com.threerings.util.Log; + import com.threerings.presents.dobj.DObject; import com.threerings.presents.dobj.DObjectManager; import com.threerings.presents.dobj.ObjectAccessError; diff --git a/src/as/Log.as b/src/as/com/threerings/util/Log.as similarity index 84% rename from src/as/Log.as rename to src/as/com/threerings/util/Log.as index 605f07c5c..ecaad50d3 100644 --- a/src/as/Log.as +++ b/src/as/com/threerings/util/Log.as @@ -19,22 +19,13 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -package { +package com.threerings.util { import flash.utils.getQualifiedClassName; -//import mx.logging.ILogger; -//import mx.logging.LogEventLevel; - -//import mx.logging.targets.TraceTarget; - -import com.threerings.util.LogTarget; - /** * A simple logging mechanism. * - * This class need not be imported. - * * Typical usage for creating a Log to be used by the entire class would be: * public class MyClass * { @@ -49,14 +40,6 @@ import com.threerings.util.LogTarget; * .... */ public class Log -// TODO: We should really change the name of this class. -// The reason for this is that when we load a client .swf we load it into -// a child ApplicationDomain so that it can share and interoperate with -// a few of our classes. Any classes we define will block classes of the -// same name being used by client swfs, as they'll instead instantiate -// our versions. Normally this isn't a problem because our classnames are -// things like com.threerings.io.Streamable, but this class is just "Log". -// So: we should fix this up. { /** * Retrieve a Log for the specififed class. diff --git a/src/as/com/threerings/util/LogTarget.as b/src/as/com/threerings/util/LogTarget.as index 1dd0c8b57..a1f8af246 100644 --- a/src/as/com/threerings/util/LogTarget.as +++ b/src/as/com/threerings/util/LogTarget.as @@ -22,9 +22,7 @@ package com.threerings.util { /** - * A very simple Logging interface. - * Used with the top-level class QUOTE in this package ENDQUOTE... - * (it's actually up above 'com', so it never needs importing...) + * A very simple Logging interface used by Log. */ public interface LogTarget {