mirror of
				https://github.com/owncloud/android-library.git
				synced 2025-10-31 02:17:41 +00:00 
			
		
		
		
	Stop logging in exception free way
This commit is contained in:
		
							parent
							
								
									9cbf572510
								
							
						
					
					
						commit
						080b3f56fc
					
				| @ -113,6 +113,7 @@ public class Log_OC { | ||||
| 
 | ||||
|     public static void stopLogging() { | ||||
|         try { | ||||
| 			if (mBuf != null) | ||||
|                 mBuf.close(); | ||||
|             isEnabled = false; | ||||
| 
 | ||||
| @ -123,7 +124,13 @@ public class Log_OC { | ||||
|             isEnabled = false; | ||||
| 
 | ||||
|         } catch (IOException e) { | ||||
|             e.printStackTrace(); | ||||
|             // Because we are stopping logging, we only lon to Android console. | ||||
|             Log.e("OC_Log", "Closing log file failed: ", e); | ||||
|         } catch (Exception e) { | ||||
|             // This catch should never fire because we do null check on mBuf. | ||||
|             // But just for the sake of stability let's log this odd situation. | ||||
|             // Because we are stopping logging, we only lon to Android console. | ||||
|             Log.e("OC_Log", "Stopping logging failed: ", e); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user