1
0
mirror of https://github.com/owncloud/android-library.git synced 2025-06-08 08:26:10 +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:
Bartosz Przybylski 2015-11-21 17:22:12 +01:00 committed by David A. Velasco
parent 17325dd43f
commit 45650d2307

View File

@ -73,7 +73,7 @@ public class Log_OC {
* Start doing logging
* @param storagePath : directory for keeping logs
*/
public static void startLogging(String storagePath) {
synchronized public static void startLogging(String storagePath) {
String logPath = storagePath + File.separator +
mOwncloudDataFolderLog + File.separator + LOG_FOLDER_NAME;
mFolder = new File(logPath);
@ -111,7 +111,7 @@ public class Log_OC {
}
}
public static void stopLogging() {
synchronized public static void stopLogging() {
try {
if (mBuf != null)
mBuf.close();
@ -164,7 +164,7 @@ public class Log_OC {
* Append to the log file the info passed
* @param text : text for adding to the log file
*/
private static void appendLog(String text) {
synchronized private static void appendLog(String text) {
if (isEnabled) {