10

quick question, I've been looking for a simple logging tool for AS3 projects (I do not want any Flex dependencies) and my impression so far has been that there is no actively developed project.

What I need is basic logging, and adapters to allow me to send logging to file (using AIR and a LocalConnection maybe) and maybe send to html div etc.

Anyone have any opinions on a simple, light weight project?

BefittingTheorem
  • 10,459
  • 15
  • 69
  • 96

7 Answers7

7

We have recently started a project called AS3Commons that contains an early implementation of an AS3 Logging framework. We're aiming to provide a Logging abstraction API that allows you to plug in adapters for other logging frameworks. We also have a built-in logger that logs using trace.

It's usage is similar to other logging frameworks.

private static var logger:ILogger = LoggerFactory.getLogger("com.domain.Class");

Check it at http://code.google.com/p/as3-commons/

Any feedback is appreciated.

Christophe Herreman
  • 15,895
  • 9
  • 58
  • 86
5

This is the best as3 logger by far!!!!

http://arthropod.stopp.se/

4

There is a standard Logging API in AS3. You can set it up to log to different targets. For instance, if you're using AIR, you could get it to log to a file using the FileTarget in as3corelib.

Setting up:

var logFile:File = File.applicationStorageDirectory.resolvePath("logs/logfile.log");
var logTarget:FileTarget = new FileTarget(logFile);
logTarget.filters = ["path.to.Class"];
logTarget.level = LogEventLevel.ALL;
logTarget.includeDate = true;
logTarget.includeTime = true;
logTarget.includeCategory = true;
logTarget.includeLevel = true;
Log.addTarget(logTarget);

Logging:

var log:ILogger = Log.getLogger("path.to.Class");
log.info("testing the logging...");
Rhys Causey
  • 787
  • 7
  • 21
  • Thanks Rhy but the ILogger interface and Log class are defined within the framework.swc, which is the Flex framework. I'm looking for a logging solution without having to depends on Flex. The mojority of my projects to not need Flex. – BefittingTheorem Mar 06 '09 at 10:37
1

I'm always surprised at the number of people who haven't heard of Arthropod. It does everything you described and more. Including password encrypted connections. Arthropod is also set up in a way that it is very easy to make quick edits to the class for your specific needs.

Jonathan Dumaine
  • 5,575
  • 3
  • 38
  • 50
  • Arthropod is good for straight traces. For a great, fully featured, remote debugger, check out DeMonster Debugger: http://demonsterdebugger.com – cleverbit Oct 31 '11 at 11:12
0

I found the best solution for me is combining as3commons-logging with Arthropod, like so:

LOGGER_FACTORY.setup = new SimpleTargetSetup(mergeTargets(new TraceTarget(), new ArthropodTarget()));

Then, if you have a client who is having issues but can't tail the flashlog, they can just fire up Arhtropod. Awesome!

Viktor Nordling
  • 8,694
  • 4
  • 26
  • 23
0

I've got a Flash-friendly logging project going. It's nothing big (yet?) but it's light and handy. It does (optionally) take advantage of Arthropod (a great project) but you can pretty easily shoot the output anywhere you like. It works similarly to the Flex framework so if you are familiar with that then the transition would be painless.

You can read about the project and download the goods here.

Jason Crist
  • 138
  • 5
0

MonsterDebugger has more options than it sounds like you're looking for. But it is small and has some very handy features. Including instance inspection, editing properties, calling methods remotely from the air console, and browsing/editing the display tree.

http://monsterdebugger.com/

They made a game so you could learn the debugger, its great.

LessQuesar
  • 3,123
  • 1
  • 21
  • 29