Logging API for AS3

前端 未结 7 2039
时光取名叫无心
时光取名叫无心 2020-12-29 12:23

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 active

相关标签:
7条回答
  • 2020-12-29 12:50

    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!

    0 讨论(0)
  • 2020-12-29 13:01

    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.

    0 讨论(0)
  • 2020-12-29 13:01

    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...");
    
    0 讨论(0)
  • 2020-12-29 13:01

    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.

    0 讨论(0)
  • 2020-12-29 13:04

    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.

    0 讨论(0)
  • 2020-12-29 13:11

    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.

    0 讨论(0)
提交回复
热议问题