Hi,

one of the easiest methods to override/set a logger is to either use mtasc,
which allows you to specify where the traces go, you can specify a class and
method to trace to OR another method is to replace all traces with
_global.log and add
_global.log = function (info:String) { trace (info); } for starters.

That gives you a quick start with a logger that's easy to replace later.

We use our own custom logger, built upon a custom reflection engine (in
As2), which combines log statements per method call and is very easy to use.

for example if I use _global.log ("here", {a:2, b:3}) it would print:

[LOG]: MyClass.myMethod says:
[0] here
[1] object ->
     a:2,
     b:3

We thought long and hard about using _global.log vs Logger.log (ie _global
untyped vs static typed), but in this specific case we decided to go with
_global.log.

greetz
JC

On Tue, Jul 15, 2008 at 7:24 AM, Adam Jowett <[EMAIL PROTECTED]>
wrote:

> Hi all,
>
>
>
> A very quick one, I haven't had to over-ride or extend built in classes
> since the good old days of prototyping in AS1, specifically this time I
> want
> to extend the built in trace() statement with some conditions etc. Can this
> be done? or do I need to do my own custom logger such as those out there at
> the moment?
>
>
>
> Cheers
>
> Adam
>
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to