mirror of
				https://github.com/owncloud/android-library.git
				synced 2025-10-31 02:17:41 +00:00 
			
		
		
		
	Sychronize methods for logging starting and stopping.
First of, this will prevent logs mixing, sencondly this will allow user to safely migrate data even when other thread will call logging functions
This commit is contained in:
		
							parent
							
								
									17325dd43f
								
							
						
					
					
						commit
						45650d2307
					
				| @ -73,7 +73,7 @@ public class Log_OC { | |||||||
|      * Start doing logging |      * Start doing logging | ||||||
|      * @param storagePath : directory for keeping logs |      * @param storagePath : directory for keeping logs | ||||||
|      */ |      */ | ||||||
|     public static void startLogging(String storagePath) { |     synchronized public static void startLogging(String storagePath) { | ||||||
| 		String logPath = storagePath + File.separator + | 		String logPath = storagePath + File.separator + | ||||||
| 			mOwncloudDataFolderLog + File.separator + LOG_FOLDER_NAME; | 			mOwncloudDataFolderLog + File.separator + LOG_FOLDER_NAME; | ||||||
|         mFolder = new File(logPath); |         mFolder = new File(logPath); | ||||||
| @ -111,7 +111,7 @@ public class Log_OC { | |||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     public static void stopLogging() { |     synchronized public static void stopLogging() { | ||||||
|         try { |         try { | ||||||
| 			if (mBuf != null) | 			if (mBuf != null) | ||||||
|                 mBuf.close(); |                 mBuf.close(); | ||||||
| @ -164,7 +164,7 @@ public class Log_OC { | |||||||
|      * Append to the log file the info passed |      * Append to the log file the info passed | ||||||
|      * @param text : text for adding to the log file |      * @param text : text for adding to the log file | ||||||
|      */ |      */ | ||||||
|     private static void appendLog(String text) {  |     synchronized private static void appendLog(String text) { | ||||||
| 
 | 
 | ||||||
|         if (isEnabled) { |         if (isEnabled) { | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user