projects
/
pub
/
Android
/
ownCloud.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Visualize both older and current log files info in the log history view and send...
[pub/Android/ownCloud.git]
/
src
/
com
/
owncloud
/
android
/
utils
/
Log_OC.java
diff --git
a/src/com/owncloud/android/utils/Log_OC.java
b/src/com/owncloud/android/utils/Log_OC.java
index
defae21
..
f492e26
100644
(file)
--- a/
src/com/owncloud/android/utils/Log_OC.java
+++ b/
src/com/owncloud/android/utils/Log_OC.java
@@
-19,7
+19,9
@@
public class Log_OC {
private static File mFolder;
private static BufferedWriter mBuf;
private static File mFolder;
private static BufferedWriter mBuf;
- private static String[] mLogFileNames = {"currentLog.txt", "backupLog.txt"};
+ private static String[] mLogFileNames = {"currentLog.txt", "olderLog.txt"};
+ private static String mLogPath = FileStorageUtils.getLogPath();
+
private static boolean isMaxFileSizeReached = false;
public static void i(String TAG, String message){
private static boolean isMaxFileSizeReached = false;
public static void i(String TAG, String message){
@@
-60,7
+62,7
@@
public class Log_OC {
Log.wtf(TAG,message);
appendLog(TAG+" : "+ message);
}
Log.wtf(TAG,message);
appendLog(TAG+" : "+ message);
}
-
+
/**
* Start doing logging
* @param logPath : path of log file
/**
* Start doing logging
* @param logPath : path of log file
@@
-82,9
+84,9
@@
public class Log_OC {
if (isMaxFileSizeReached) {
// Move current log file info to another file
if (isMaxFileSizeReached) {
// Move current log file info to another file
- File
secondLog
File = new File(mFolder + File.separator + mLogFileNames[1]);
+ File
older
File = new File(mFolder + File.separator + mLogFileNames[1]);
if (mLogFile.exists()) {
if (mLogFile.exists()) {
- mLogFile.renameTo(
secondLog
File);
+ mLogFile.renameTo(
older
File);
}
// Construct a new file for current log info
}
// Construct a new file for current log info
@@
-140,8
+142,7
@@
public class Log_OC {
* @param text : text for adding to the log file
*/
private static void appendLog(String text) {
* @param text : text for adding to the log file
*/
private static void appendLog(String text) {
- String logPath = Environment.getExternalStorageDirectory()+File.separator+"owncloud"+File.separator+"log";
- startLogging(logPath);
+ startLogging(mLogPath);
String timeStamp = new SimpleDateFormat(SIMPLE_DATE_FORMAT).format(Calendar.getInstance().getTime());
try {
String timeStamp = new SimpleDateFormat(SIMPLE_DATE_FORMAT).format(Calendar.getInstance().getTime());
try {
@@
-153,4
+154,12
@@
public class Log_OC {
e.printStackTrace();
}
}
e.printStackTrace();
}
}
+
+ public static String[] getLogFileNames() {
+ return mLogFileNames;
+ }
+
+ public static void setmLogFileNames(String[] logFileNames) {
+ Log_OC.mLogFileNames = logFileNames;
+ }
}
}