Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d54fa5ed authored by Bartosz Przybylski's avatar Bartosz Przybylski Committed by Andy Scherzinger
Browse files

Stop logging in exception free way

parent fbb7bbe9
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -113,6 +113,7 @@ public class Log_OC {

    public static void stopLogging() {
        try {
			if (mBuf != null)
                mBuf.close();
            isEnabled = false;

@@ -123,7 +124,13 @@ public class Log_OC {
            isEnabled = false;

        } catch (IOException e) {
            e.printStackTrace();
            // Because we are stopping logging, we only lon to Android console.
            Log.e("OC_Log", "Closing log file failed: ", e);
        } catch (Exception e) {
            // This catch should never fire because we do null check on mBuf.
            // But just for the sake of stability let's log this odd situation.
            // Because we are stopping logging, we only lon to Android console.
            Log.e("OC_Log", "Stopping logging failed: ", e);
        }
    }