You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by Hugo Ferreira <hf...@gmail.com> on 2022/11/11 23:31:33 UTC

Debug mode

Hi,

There is any way/global variable/etc ... to check if the code is running in
debug mode using VS Code ?

The reason is that I would like to show a specific error message with the
full exception on the screen only with debug mode.

Thank you,
Hugo.

Re: Debug mode

Posted by Hugo Ferreira <hf...@gmail.com>.
Thank you.

If any one in the future search on the mailing list:

Add -define+=CONFIG::DEBUG,true to the additionalOptions of the VS Code.

Example of usage:

private function onRemoteServiceFault(event:FaultEvent):void
{
CONFIG::DEBUG
{
Toast.showError(event.message.detail);
return;
}

Toast.showError(LocaleManager.getInstance().localeStrings.GlobalError);
}

I my case I wanted to show a generic message to contact the support if
something goes wrong and a detailed technical message when I'mm working in
a debug mode.

Don't forget to change CONFIG::DEBUG,true to CONFIG::DEBUG,false before
compile to release.

Yishay Weiss <yi...@hotmail.com> escreveu no dia sábado, 12/11/2022
à(s) 07:35:

> I think you can use compiler.define [1]
>
> [1] Compiler Options (apache.github.io)<
> https://apache.github.io/royale-docs/compiler/compiler-options>
>
> From: Hugo Ferreira<ma...@gmail.com>
> Sent: Saturday, November 12, 2022 1:31 AM
> To: dev@royale.apache.org<ma...@royale.apache.org>
> Subject: Debug mode
>
> Hi,
>
> There is any way/global variable/etc ... to check if the code is running in
> debug mode using VS Code ?
>
> The reason is that I would like to show a specific error message with the
> full exception on the screen only with debug mode.
>
> Thank you,
> Hugo.
>
>

RE: Debug mode

Posted by Yishay Weiss <yi...@hotmail.com>.
I think you can use compiler.define [1]

[1] Compiler Options (apache.github.io)<https://apache.github.io/royale-docs/compiler/compiler-options>

From: Hugo Ferreira<ma...@gmail.com>
Sent: Saturday, November 12, 2022 1:31 AM
To: dev@royale.apache.org<ma...@royale.apache.org>
Subject: Debug mode

Hi,

There is any way/global variable/etc ... to check if the code is running in
debug mode using VS Code ?

The reason is that I would like to show a specific error message with the
full exception on the screen only with debug mode.

Thank you,
Hugo.