Suppress loggin for one action

Hi,

in a FB 5.5 script I call an external programm that requires username + password as parameter (via "execute programm").

Now, I want to have this action excluded from the log, so that username + pw do not appear in the log (with FB 5.5 Server, all server users could look up this info in the log).

Any chance?

 

Regards,

-Carsten

Hi Carsten,

Thanks for your post.

There's a "Suppress Log Messages" option on the Runtime property page of the action.  This will omit all of the action's output from the log.



Alternatively, if you don't want to suppress _all_ of the output of the action, then you can use the OnStatusMessage event to modify the output of the action.

A trivial example in JScript:

if(StatusMessage.MessageText.indexOf('myExecutable.exe') > -1)
StatusMessage.MessageText = "Overriden!";


If you have the password stored in a FinalBuilder variable then you could do something like:

StatusMessage.MessageText = StatusMessage.MessageText.replace('-P ' + myPassword, '-P*HIDDEN*');

(Replace the -P with whatever option you use to pass in the password.)


Finally, and most trickily, you can use a regular expression to take out any password. Something like this:

StatusMessage.MessageText = StatusMessage.MessageText.replace(/-P[^\s]+/, '-P*REMOVED*');

(This is assuming your password doesn't contain whitespace, and it prefixed by -P. You'll need to edit it to match the exact specifics of your password syntax. If it contains spaces, then just match everything within two quotes.)

Hth. Please let us know if you need any more assistance.

Regards,

Angus

Hi Angus,

>>StatusMessage.MessageText = StatusMessage.MessageText.replace('-P ' + myPassword, '-P*HIDDEN*');

This did the trick. Great, how simple the .MessageText can be modified!

Thanks,

-Carsten