mirror of
https://github.com/owncloud/android-library.git
synced 2025-06-07 16:06:08 +00:00
add log level to output
this is a pre-task to colorize log output and add ability to filter on loglevel
This commit is contained in:
parent
4323c3a89b
commit
6b61e66318
@ -32,37 +32,37 @@ public class Log_OC {
|
|||||||
|
|
||||||
public static void i(String TAG, String message) {
|
public static void i(String TAG, String message) {
|
||||||
Log.i(TAG, message);
|
Log.i(TAG, message);
|
||||||
appendLog(TAG + " : " + message);
|
appendLog("I: " + TAG + " : " + message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void d(String TAG, String message) {
|
public static void d(String TAG, String message) {
|
||||||
Log.d(TAG, message);
|
Log.d(TAG, message);
|
||||||
appendLog(TAG + " : " + message);
|
appendLog("D: " + TAG + " : " + message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void d(String TAG, String message, Exception e) {
|
public static void d(String TAG, String message, Exception e) {
|
||||||
Log.d(TAG, message, e);
|
Log.d(TAG, message, e);
|
||||||
appendLog(TAG + " : " + message + " Exception : " + e.getStackTrace());
|
appendLog("D: " + 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);
|
Log.e(TAG, message);
|
||||||
appendLog(TAG + " : " + message);
|
appendLog("E: " + TAG + " : " + message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void e(String TAG, String message, Throwable e) {
|
public static void e(String TAG, String message, Throwable e) {
|
||||||
Log.e(TAG, message, e);
|
Log.e(TAG, message, e);
|
||||||
appendLog(TAG + " : " + message + " Exception : " + e.getStackTrace());
|
appendLog("E: " + 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);
|
Log.v(TAG, message);
|
||||||
appendLog(TAG + " : " + message);
|
appendLog("V: " + TAG + " : " + message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void w(String TAG, String message) {
|
public static void w(String TAG, String message) {
|
||||||
Log.w(TAG, message);
|
Log.w(TAG, message);
|
||||||
appendLog(TAG + " : " + message);
|
appendLog("W: " + TAG + " : " + message);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -71,8 +71,7 @@ public class Log_OC {
|
|||||||
* @param storagePath : directory for keeping logs
|
* @param storagePath : directory for keeping logs
|
||||||
*/
|
*/
|
||||||
synchronized 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);
|
||||||
mLogFile = new File(mFolder + File.separator + mLogFileNames[0]);
|
mLogFile = new File(mFolder + File.separator + mLogFileNames[0]);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user