mirror of
				https://github.com/owncloud/android-library.git
				synced 2025-10-30 09:57:39 +00:00 
			
		
		
		
	apply codestyle request for complete file
This commit is contained in:
		
							parent
							
								
									dffd5bed9f
								
							
						
					
					
						commit
						6560aa987d
					
				| @ -26,45 +26,48 @@ public class Log_OC { | ||||
|     private static boolean isMaxFileSizeReached = false; | ||||
|     private static boolean isEnabled = false; | ||||
| 
 | ||||
|     public static void setLogDataFolder(String logFolder){ | ||||
|     public static void setLogDataFolder(String logFolder) { | ||||
|         mOwncloudDataFolderLog = logFolder; | ||||
|     } | ||||
| 
 | ||||
|     public static void i(String TAG, String message){ | ||||
|     public static void i(String TAG, String message) { | ||||
|         Log.i(TAG, message); | ||||
|         appendLog(TAG+" : "+ message); | ||||
|         appendLog(TAG + " : " + message); | ||||
|     } | ||||
| 
 | ||||
|     public static void d(String TAG, String message){ | ||||
|     public static void d(String TAG, String message) { | ||||
|         Log.d(TAG, message); | ||||
|         appendLog(TAG + " : " + message); | ||||
|     } | ||||
| 
 | ||||
|     public static void d(String TAG, String message, Exception e) { | ||||
|         Log.d(TAG, message, e); | ||||
|         appendLog(TAG + " : " + message + " Exception : "+ e.getStackTrace()); | ||||
|         appendLog(TAG + " : " + message + " Exception : " + e.getStackTrace()); | ||||
|     } | ||||
|     public static void e(String TAG, String message){ | ||||
| 
 | ||||
|     public static void e(String TAG, String message) { | ||||
|         Log.e(TAG, message); | ||||
|         appendLog(TAG + " : " + message); | ||||
|     } | ||||
| 
 | ||||
|     public static void e(String TAG, String message, Throwable e) { | ||||
|         Log.e(TAG, message, e); | ||||
|         appendLog(TAG+" : " + message +" Exception : " + e.getStackTrace()); | ||||
|         appendLog(TAG + " : " + message + " Exception : " + e.getStackTrace()); | ||||
|     } | ||||
| 
 | ||||
|     public static void v(String TAG, String message){ | ||||
|     public static void v(String TAG, String message) { | ||||
|         Log.v(TAG, message); | ||||
|         appendLog(TAG+" : "+ message); | ||||
|         appendLog(TAG + " : " + message); | ||||
|     } | ||||
| 
 | ||||
|     public static void w(String TAG, String message) { | ||||
|         Log.w(TAG, message); | ||||
|         appendLog(TAG+" : "+ message); | ||||
|         appendLog(TAG + " : " + message); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Start doing logging | ||||
|      * | ||||
|      * @param storagePath : directory for keeping logs | ||||
|      */ | ||||
|     synchronized public static void startLogging(String storagePath) { | ||||
| @ -95,10 +98,10 @@ public class Log_OC { | ||||
|         } catch (IOException e) { | ||||
|             e.printStackTrace(); | ||||
|         } finally { | ||||
|             if(mBuf != null) { | ||||
|             if (mBuf != null) { | ||||
|                 try { | ||||
|                     mBuf.close(); | ||||
|                 } catch(IOException e) { | ||||
|                 } catch (IOException e) { | ||||
|                     e.printStackTrace(); | ||||
|                 } | ||||
|             } | ||||
| @ -107,8 +110,9 @@ public class Log_OC { | ||||
| 
 | ||||
|     synchronized public static void stopLogging() { | ||||
|         try { | ||||
| 			if (mBuf != null) | ||||
|             if (mBuf != null) { | ||||
|                 mBuf.close(); | ||||
|             } | ||||
|             isEnabled = false; | ||||
| 
 | ||||
|             mLogFile = null; | ||||
| @ -132,7 +136,7 @@ public class Log_OC { | ||||
|      */ | ||||
|     public static void deleteHistoryLogging() { | ||||
|         File folderLogs = new File(mFolder + File.separator); | ||||
|         if(folderLogs.isDirectory()){ | ||||
|         if (folderLogs.isDirectory()) { | ||||
|             String[] myFiles = folderLogs.list(); | ||||
|             for (String myFile1 : myFiles) { | ||||
|                 File myFile = new File(folderLogs, myFile1); | ||||
| @ -155,6 +159,7 @@ public class Log_OC { | ||||
| 
 | ||||
|     /** | ||||
|      * Append to the log file the info passed | ||||
|      * | ||||
|      * @param text : text for adding to the log file | ||||
|      */ | ||||
|     synchronized private static void appendLog(String text) { | ||||
| @ -179,7 +184,7 @@ public class Log_OC { | ||||
|             try { | ||||
|                 mBuf = new BufferedWriter(new FileWriter(mLogFile, true)); | ||||
|                 mBuf.newLine(); | ||||
| 	            mBuf.write(timeStamp+" "+text); | ||||
|                 mBuf.write(timeStamp + " " + text); | ||||
|             } catch (IOException e) { | ||||
|                 e.printStackTrace(); | ||||
|             } finally { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user