我无法记录已发布的 Flash 或 ActionScript 应用程序的错误吗?

发布于 2024-12-05 16:06:44 字数 688 浏览 13 评论 0原文

我想记录应用程序的所有错误消息和调用堆栈(如果在将应用程序发布到网站后导致错误)。
我会将日志保存在网络服务器上的文件中。

在调试播放器中 Error.message 包含详细的错误消息,并且 Error.getStackTrace() 返回调用堆栈:

message: Error #1006: cccc is not a function.

stack trace:
 TypeError: Error #1006: cccc is not a function.
 at f()[/source/Main.as:38]


但在我的应用程序的用户使用的普通播放器中,Error.message 仅包含错误代码,Error.getStackTrace() 返回 null:

message: Error #1006

stack trace: null


在使用 javascript、PHP 或 ruby​​ 等语言编写的其他 Web 应用程序中,我总是记录错误或堆栈跟踪。
但在actionscript或flash应用中,我不能知道发布后在哪里以及为什么会出现错误吗?

已发布的Flash应用程序保存错误日志是否正常?

I want to log all error messages and call stacks of my application if it causes errors after I released the application to the web site.
I will save the logs on files on the web server.

In debug player Error.message contains a detailed error message and Error.getStackTrace() returns call stack:

message: Error #1006: cccc is not a function.

stack trace:
 TypeError: Error #1006: cccc is not a function.
 at f()[/source/Main.as:38]

But in normal player which users of my application use, Error.message contains only error code and Error.getStackTrace() returns null:

message: Error #1006

stack trace: null

In other web application written with languages like javascript, PHP or ruby, I always log errors or stack trace.
But in actionscript or flash application, can't I know where and why errors occur after releasing it?

Is it normal to save logs of errors in released flash applications?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

离不开的别离 2024-12-12 16:06:44

发布模式和调试模式之间的主要区别在于,所有调试信息都会从发布的 swf 中删除。因此,如果您在发行版中编译 swf,它将更轻、更快,并且无法向您显示具体崩溃的原因。

为了实现您想要做的事情,您应该在调试模式下编译并通过 HTML 上下文或 FlashPlayer 功能设置一个变量来捕获每个错误并记录它而不是抛出它。

The main difference between Release mode and Debug mode is that all debug infos are removed from the released swf. Therefore, if you compile your swf in release, it will be lighter, faster and won't be able to show you why specifically it crashed.

To achieve what you want to do, you should then compile in debug mode and set a variable through the HTML context or FlashPlayer capabilities to catch every error and log it instead of throwing it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文