Fixed AddFileLog, there's now a log created in /sdcard/Android/data/org.hedgewars.mobile/cache/Data/ hedgeroid
authorXeli
Fri, 26 Aug 2011 18:24:29 +0200
branchhedgeroid
changeset 5661 45618bdce725
parent 5659 20eb5765a5d0
child 5663 b13d1897d06f
Fixed AddFileLog, there's now a log created in /sdcard/Android/data/org.hedgewars.mobile/cache/Data/
hedgewars/uConsole.pas
hedgewars/uUtils.pas
--- a/hedgewars/uConsole.pas	Fri Aug 26 18:20:18 2011 +0200
+++ b/hedgewars/uConsole.pas	Fri Aug 26 18:24:29 2011 +0200
@@ -53,10 +53,10 @@
     done: boolean;
 begin
 {$IFNDEF NOCONSOLE}
- {$IFDEF ANDROID}
+AddFileLog('[Con] ' + s);
+{$IFDEF ANDROID}
   Log.__android_log_write(Log.Android_LOG_DEBUG, 'HW_Engine', ShortStringAsPChar('[Con]' + s));
 {$ELSE}
-AddFileLog('[Con] ' + s);
 Write(stderr, s);
 done:= false;
 
--- a/hedgewars/uUtils.pas	Fri Aug 26 18:20:18 2011 +0200
+++ b/hedgewars/uUtils.pas	Fri Aug 26 18:24:29 2011 +0200
@@ -21,7 +21,7 @@
 unit uUtils;
 
 interface
-uses uTypes, uFloat, GLunit, uConsole;
+uses uTypes, uFloat, GLunit;
 
 procedure SplitBySpace(var a, b: shortstring);
 procedure SplitByChar(var a, b: ansistring; c: char);
@@ -262,13 +262,9 @@
 begin
 s:= s;
 {$IFDEF DEBUGFILE}
-{$IFDEF ANDROID}
- WriteToConsole(s);
-{$ELSE}
 writeln(f, GameTicks: 6, ': ', s);
 flush(f)
 {$ENDIF}
-{$ENDIF}
 end;
 
 
@@ -337,12 +333,13 @@
 end;
 
 procedure initModule;
-{$IFDEF DEBUGFILE}{$IFNDEF IPHONEOS}var i: LongInt;{$ENDIF}{$ENDIF}
+{$IFDEF DEBUGFILE}{$IFNDEF MOBILE}var i: LongInt;{$ENDIF}{$ENDIF}
 begin
 {$IFDEF DEBUGFILE}
 {$I-}
-{$IFDEF IPHONEOS}
-    Assign(f,'../Documents/hw-' + cLogfileBase + '.log');
+{$IFDEF MOBILE}
+    {$IFDEF IPHONEOS} Assign(f,'../Documents/hw-' + cLogfileBase + '.log'); {$ENDIF}
+    {$IFDEF ANDROID} Assign(f,pathPrefix + '/' + cLogfileBase + '.log'); {$ENDIF}
     Rewrite(f);
 {$ELSE}
     if (ParamStr(1) <> '') and (ParamStr(2) <> '') then