Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to output some log to console when developing flex application?

I'm new to flex, and trying to write some demo applications. Now I have a very newbie question: How to output some log to console(or somewhere else I can see) in a flex application?

In other language, I can use:

System.out.println("mylog");
console.log("mylog");

But I don't know how to do the same in flex.

like image 787
Freewind Avatar asked Jul 23 '12 10:07

Freewind


2 Answers

As mentioned here, you can achieve this by doing

import flash.external.ExternalInterface;
ExternalInterface.call("console.log", "YourString");
like image 83
sleepycal Avatar answered Oct 11 '22 13:10

sleepycal


You have several options here:

  • trace()
  • Flex loggers
  • Flex-console (uses MiniDebugTarget)
like image 43
Florent Avatar answered Oct 11 '22 13:10

Florent