Simplified logging facilities.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4131 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -5,7 +5,6 @@ import flash.utils.describeType;
|
||||
import mx.collections.ArrayCollection;
|
||||
|
||||
import com.threerings.util.Name;
|
||||
import com.threerings.presents.Log;
|
||||
import com.threerings.presents.data.TimeBaseMarshaller;
|
||||
import com.threerings.presents.dobj.DSet;
|
||||
import com.threerings.presents.dobj.QSet;
|
||||
@@ -18,6 +17,8 @@ import com.threerings.presents.net.BootstrapData;
|
||||
|
||||
public class TestClient extends Client
|
||||
{
|
||||
private static const log :Log = Log.getLog(TestClient);
|
||||
|
||||
public function TestClient ()
|
||||
{
|
||||
super(new UsernamePasswordCreds(new Name("Ray"), "fork-u-2"));
|
||||
@@ -26,10 +27,10 @@ public class TestClient extends Client
|
||||
|
||||
var g1 :String = null;
|
||||
var g2 :String = (com.threerings.util.Util.cast(g1, String) as String);
|
||||
Log.debug("foo: " + (g1 === g2) + ", *" + g2 + "*, "); // + g2.length);
|
||||
log.debug("foo: " + (g1 === g2) + ", *" + g2 + "*, "); // + g2.length);
|
||||
|
||||
var ob :Object = "this is a string";
|
||||
Log.debug("part of an object: " + ob.substring(1));
|
||||
log.debug("part of an object: " + ob.substring(1));
|
||||
|
||||
var arr :Array = new Array();
|
||||
arr[0] = "Florp";
|
||||
@@ -37,17 +38,17 @@ public class TestClient extends Client
|
||||
arr[2] = "Swissbrat";
|
||||
|
||||
for (var key:* in arr) {
|
||||
Log.debug("a key=" + key + " -> " + arr[key]);
|
||||
log.debug("a key=" + key + " -> " + arr[key]);
|
||||
}
|
||||
delete arr[1];
|
||||
arr["1"] = "oinkenheimer";
|
||||
for (var key:* in arr) {
|
||||
Log.debug("a key=" + key + " -> " + arr[key]);
|
||||
log.debug("a key=" + key + " -> " + arr[key]);
|
||||
}
|
||||
Log.debug("length: " + arr.length);
|
||||
Log.debug("arr[0]: " + arr[0]);
|
||||
Log.debug("arr[1]: " + arr[1]);
|
||||
Log.debug("arr[2]: " + arr[2]);
|
||||
log.debug("length: " + arr.length);
|
||||
log.debug("arr[0]: " + arr[0]);
|
||||
log.debug("arr[1]: " + arr[1]);
|
||||
log.debug("arr[2]: " + arr[2]);
|
||||
//testFunc(2);
|
||||
|
||||
var bob :Person = new Person("Bob");
|
||||
@@ -55,25 +56,25 @@ public class TestClient extends Client
|
||||
var bob2 :Person = new Person("Bob");
|
||||
bob.callPrintName(jim.printName);
|
||||
|
||||
Log.debug("bob == jim: " + (bob == jim));
|
||||
Log.debug("bob === jim: " + (bob === jim));
|
||||
Log.debug("bob == bob2: " + (bob == bob2));
|
||||
Log.debug("bob === bob2: " + (bob === bob2));
|
||||
Log.debug("bob == bob: " + (bob == bob));
|
||||
Log.debug("bob === bob: " + (bob === bob));
|
||||
log.debug("bob == jim: " + (bob == jim));
|
||||
log.debug("bob === jim: " + (bob === jim));
|
||||
log.debug("bob == bob2: " + (bob == bob2));
|
||||
log.debug("bob === bob2: " + (bob === bob2));
|
||||
log.debug("bob == bob: " + (bob == bob));
|
||||
log.debug("bob === bob: " + (bob === bob));
|
||||
|
||||
var list :ArrayCollection = new ArrayCollection();
|
||||
list.addItem(bob);
|
||||
Log.debug("jim's indeX: " + list.getItemIndex(jim));
|
||||
Log.debug("bob2's indeX: " + list.getItemIndex(bob2));
|
||||
Log.debug("function: " + describeType(testFunc).toXMLString());
|
||||
Log.debug("func length: " + testFunc.length);
|
||||
Log.debug("funcToString: " + testFunc);
|
||||
Log.debug("interfaces: " + describeType(Bint));
|
||||
log.debug("jim's indeX: " + list.getItemIndex(jim));
|
||||
log.debug("bob2's indeX: " + list.getItemIndex(bob2));
|
||||
log.debug("function: " + describeType(testFunc).toXMLString());
|
||||
log.debug("func length: " + testFunc.length);
|
||||
log.debug("funcToString: " + testFunc);
|
||||
log.debug("interfaces: " + describeType(Bint));
|
||||
|
||||
var funcy :Function = function (i :int) :void {
|
||||
Log.debug("i is " + i);
|
||||
Log.debug("first list item is " + list[0]);
|
||||
log.debug("i is " + i);
|
||||
log.debug("first list item is " + list[0]);
|
||||
}
|
||||
|
||||
_savedFunc = funcy;
|
||||
@@ -84,8 +85,8 @@ public class TestClient extends Client
|
||||
var a :Object = new OldClass();
|
||||
var c :Class = OldClass;
|
||||
|
||||
Log.debug("instance: " + describeType(a).toXMLString());
|
||||
Log.debug("class : " + describeType(Pork).toXMLString());
|
||||
log.debug("instance: " + describeType(a).toXMLString());
|
||||
log.debug("class : " + describeType(Pork).toXMLString());
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -93,18 +94,18 @@ public class TestClient extends Client
|
||||
var c :Object = 2.4;
|
||||
var d :Object = new HooperClass(this);
|
||||
|
||||
Log.debug("1) " + (a as HelperClass));
|
||||
Log.debug("2) " + (b as HelperClass));
|
||||
Log.debug("3) " + HelperClass(a));
|
||||
//Log.debug("4) " + HelperClass(b));
|
||||
Log.debug("5) " + (c as int));
|
||||
Log.debug("6) " + int(c));
|
||||
log.debug("1) " + (a as HelperClass));
|
||||
log.debug("2) " + (b as HelperClass));
|
||||
log.debug("3) " + HelperClass(a));
|
||||
//log.debug("4) " + HelperClass(b));
|
||||
log.debug("5) " + (c as int));
|
||||
log.debug("6) " + int(c));
|
||||
|
||||
//Log.debug("7) " + (d === a));
|
||||
//log.debug("7) " + (d === a));
|
||||
|
||||
Log.debug("8) " + (a as HooperClass));
|
||||
Log.debug("9) " + HelperClass(d));
|
||||
//Log.debug("X) " + HooperClass(a));
|
||||
log.debug("8) " + (a as HooperClass));
|
||||
log.debug("9) " + HelperClass(d));
|
||||
//log.debug("X) " + HooperClass(a));
|
||||
|
||||
var x :HelperClass = HelperClass(d);
|
||||
var y :HelperClass = (d as HelperClass);
|
||||
@@ -113,11 +114,11 @@ public class TestClient extends Client
|
||||
x.hype();
|
||||
y.hype();
|
||||
z.hype();
|
||||
Log.debug("x === d: " + (x === d));
|
||||
Log.debug("y === d: " + (y === d));
|
||||
Log.debug("x === y: " + (x === y));
|
||||
Log.debug("d === z: " + (d === z));
|
||||
Log.debug("y === z: " + (y === z));
|
||||
log.debug("x === d: " + (x === d));
|
||||
log.debug("y === d: " + (y === d));
|
||||
log.debug("x === y: " + (x === y));
|
||||
log.debug("d === z: " + (d === z));
|
||||
log.debug("y === z: " + (y === z));
|
||||
*/
|
||||
|
||||
//var ta :TypedArray = new TypedArray(HooperClass);
|
||||
@@ -142,13 +143,13 @@ public class TestClient extends Client
|
||||
|
||||
public function testFunc (one :int, two :int = 0, three :int = -1) :void
|
||||
{
|
||||
Log.debug("this: " + ", args: " + arguments.length +
|
||||
log.debug("this: " + ", args: " + arguments.length +
|
||||
": " + arguments);
|
||||
}
|
||||
|
||||
public function crazyArgs (num :int = 0, str :String = "lol") :void
|
||||
{
|
||||
Log.debug("crazyArgs " + num + ", " + str);
|
||||
log.debug("crazyArgs " + num + ", " + str);
|
||||
}
|
||||
|
||||
prototype var _foo :String;
|
||||
@@ -158,7 +159,6 @@ public class TestClient extends Client
|
||||
}
|
||||
}
|
||||
|
||||
import com.threerings.presents.Log;
|
||||
import com.threerings.presents.client.TestClient;
|
||||
|
||||
interface Aint {
|
||||
@@ -178,7 +178,8 @@ class Person
|
||||
|
||||
public function printName () :void
|
||||
{
|
||||
Log.debug("printName called on " + _name + "! (this=" + this + ")");
|
||||
Log.getLog(this).debug(
|
||||
"printName called on " + _name + "! (this=" + this + ")");
|
||||
}
|
||||
|
||||
public function callPrintName (funcy :Function) :void
|
||||
@@ -211,7 +212,7 @@ class HelperClass
|
||||
|
||||
public function hype () :void
|
||||
{
|
||||
Log.debug("helper hype");
|
||||
Log.getLog(this).debug("helper hype");
|
||||
}
|
||||
|
||||
protected var _cli :TestClient;
|
||||
@@ -232,7 +233,7 @@ final class HooperClass extends HelperClass
|
||||
|
||||
public override function hype () :void
|
||||
{
|
||||
Log.debug("hooper hype");
|
||||
Log.getLog(this).debug("hooper hype");
|
||||
}
|
||||
|
||||
public function porker () :void
|
||||
|
||||
Reference in New Issue
Block a user