Skip to content

Commit 8f4ce28

Browse files
author
Vladimir Demidov
committed
flash logs only with flashvar debug=1
1 parent 2757357 commit 8f4ce28

3 files changed

Lines changed: 14 additions & 3 deletions

File tree

dist/FileAPI.flash.swf

2.64 KB
Binary file not shown.

flash/src/ru/mail/controller/AppController.as

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ package ru.mail.controller
8989
// parse flashvars
9090
_options = options;
9191
JSCaller.callback = getJsFunctionName(options, JSCaller.callback);
92+
// logger
93+
LoggerJS.enable(!!options["debug"]);
9294
// error store prefix
9395
_model.storeKey = options["storeKey"];
9496
LoggerJS.log("storeKey="+_model.storeKey);

flash/src/ru/mail/utils/LoggerJS.as

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,24 @@ package ru.mail.utils
44

55
public class LoggerJS
66
{
7+
private static var on:Boolean = false;
8+
79
public function LoggerJS()
810
{
911
}
1012

13+
public static function enable(value:Boolean):void
14+
{
15+
on = value;
16+
}
17+
1118
public static function log(str:String):void
1219
{
13-
trace ("# LoggerJs.log",str);
14-
var data:Object = {type:"log", target:str};
15-
JSCaller.jsCaller.callJS(JSCaller.callback, data);
20+
if (on) {
21+
trace ("# LoggerJs.log",str);
22+
var data:Object = {type:"log", target:str};
23+
JSCaller.jsCaller.callJS(JSCaller.callback, data);
24+
}
1625
}
1726
}
1827
}

0 commit comments

Comments
 (0)