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:
parent
17325dd43f
commit
45650d2307
@ -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) {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user