Index: lams_common/src/flash/org/lamsfoundation/lams/common/DebugDialog.as =================================================================== diff -u -rb5924772ef2031120599ffcb1db7c18efd25d885 -r4a59bc06c4e01c867533da0757fe0f2f9aa13d45 --- lams_common/src/flash/org/lamsfoundation/lams/common/DebugDialog.as (.../DebugDialog.as) (revision b5924772ef2031120599ffcb1db7c18efd25d885) +++ lams_common/src/flash/org/lamsfoundation/lams/common/DebugDialog.as (.../DebugDialog.as) (revision 4a59bc06c4e01c867533da0757fe0f2f9aa13d45) @@ -142,8 +142,15 @@ */ private function showDebugLog(){ //Set the text in the text area + scroll to the bottom - messages_ta.text = debug.getFormattedMsgLog(); - messages_ta.vPosition = messages_ta.maxVPosition; + //TODO: Make this more efficient, currently the WHOLE log is re-rendered each update.... grrrr + + if(messages_ta.length < 1){ + messages_ta.text = debug.getFormattedMsgLog(); + }else{ + messages_ta.text += debug.getLatestMsg(); + } + + messages_ta.vPosition = messages_ta.maxVPosition; } /** Index: lams_common/src/flash/org/lamsfoundation/lams/common/util/Debugger.as =================================================================== diff -u -ree1c34625a4853722e5206df063132bafaedf885 -r4a59bc06c4e01c867533da0757fe0f2f9aa13d45 --- lams_common/src/flash/org/lamsfoundation/lams/common/util/Debugger.as (.../Debugger.as) (revision ee1c34625a4853722e5206df063132bafaedf885) +++ lams_common/src/flash/org/lamsfoundation/lams/common/util/Debugger.as (.../Debugger.as) (revision 4a59bc06c4e01c867533da0757fe0f2f9aa13d45) @@ -82,6 +82,7 @@ public static function log(msg:Object,level:Number,fname:String,currentClass:Object):Void{ //Ensure we have an instance getInstance(); + var rawMsgStr = String(msg); if(_allowDebug){ if(arguments.length == 1){ @@ -90,6 +91,7 @@ if(_severityLevel >= level){ var date:Date = new Date(); + //Build debug log object for this entry var obj = {date:date,msg:msg,level:level,func:fname}; @@ -101,8 +103,10 @@ obj.scope = currentClass; } - //Write to trace - msg = "["+fname+"]"+msg + //Write to trace(NOT USED??) + msg = "["+fname+"]"+msg + + //chuck it to the trace window trace(msg); @@ -157,6 +161,19 @@ } return ret; } + + /** + * @param format:Object An object containing various format options for viewing the log + * @returns the message log formatted + */ + public function getLatestMsg(format:Object):String { + var ret:String; + if(!format){ + format = {}; + format.date = false; + } + return buildMessage(format,_msgLog[_msgLog.length-1]); + } /** * Construct a message from the msgObject using the format object @@ -203,8 +220,11 @@ ret += 'date : ' + msgObj.date.toString() + ' '; } + //escape the message incase we asent XML in + var theMsg = Object(StringUtils.escapeAngleBrackets(String(msgObj.msg))); + //Add function/method + message - ret += '[' + msgObj.func + ']' + msgObj.msg; + ret += '[' + msgObj.func + ']' + theMsg; //Add closing font tag and line break ret += fontCloseTag + '
'