hedgewars/uUtils.pas
changeset 8425 4f226963faef
parent 8370 0c79946e96f8
child 8444 75db7bb8dce8
child 8498 eecadca7db50
--- a/hedgewars/uUtils.pas	Mon Jan 21 21:52:49 2013 -0500
+++ b/hedgewars/uUtils.pas	Wed Jan 23 03:37:27 2013 +0100
@@ -461,16 +461,14 @@
     InitCriticalSection(logMutex);
 {$ENDIF}
 {$I-}
-{$IFDEF MOBILE}
-    {$IFDEF IPHONEOS} Assign(f, UserPathPrefix + '/hw-' + logfileBase + '.log'); {$ENDIF}
-    {$IFDEF ANDROID} Assign(f, pathPrefix + '/' + logfileBase + '.log'); {$ENDIF}
-    i:= i; // avoid hint
-{$ELSE}
-    f:= stdout; // if everything fails, write to stderr
+    f:= stderr; // if everything fails, write to stderr
     if (UserPathPrefix <> '') then
         begin
+        // create directory if it doesn't exist
         if not FileExists(UserPathPrefix + '/Logs/') then
             CreateDir(UserPathPrefix + '/Logs/');
+
+        // if log is locked, write to the next one
         i:= 0;
         while(i < 7) do
             begin
@@ -480,7 +478,6 @@
             inc(i)
             end;
         end;
-{$ENDIF}
     Rewrite(f);
 {$I+}
 {$ENDIF}