Fixed. App crash when setting a path without slash
[pub/Android/ownCloud.git] / src / com / owncloud / android / MainApp.java
index 0b21b06..9a47bd7 100644 (file)
  */
 package com.owncloud.android;
 
  */
 package com.owncloud.android;
 
-import java.io.File;
-
 import android.app.Application;
 import android.content.Context;
 import android.app.Application;
 import android.content.Context;
-import android.os.Environment;
 
 import com.owncloud.android.lib.common.OwnCloudClientManagerFactory;
 import com.owncloud.android.lib.common.OwnCloudClientManagerFactory.Policy;
 
 import com.owncloud.android.lib.common.OwnCloudClientManagerFactory;
 import com.owncloud.android.lib.common.OwnCloudClientManagerFactory.Policy;
-import com.owncloud.android.utils.Log_OC;
+import com.owncloud.android.lib.common.utils.Log_OC;
 /**
  * Main Application of the project
  * 
 /**
  * Main Application of the project
  * 
@@ -59,10 +56,14 @@ public class MainApp extends Application {
         }
         
         if (BuildConfig.DEBUG) {
         }
         
         if (BuildConfig.DEBUG) {
-            String logpath = Environment.getExternalStorageDirectory()+File.separator+"owncloud"+File.separator+"log";
+
+            String dataFolder = getDataFolder();
+
+            // Set folder for store logs
+            Log_OC.setLogDataFolder(dataFolder);
+
+            Log_OC.startLogging();
             Log_OC.d("Debug", "start logging");
             Log_OC.d("Debug", "start logging");
-            Log_OC.v("PATH", logpath);
-            Log_OC.startLogging(logpath);
         }
     }
 
         }
     }