/*
 * Copyright (c) 2016 大前良介 (OHMAE Ryosuke)
 *
 * This software is released under the MIT License.
 * http://opensource.org/licenses/MIT
 */

package net.mm2d.dmsexplorer;

import android.app.Application;
import android.support.annotation.NonNull;

import net.mm2d.dmsexplorer.domain.AppRepository;
import net.mm2d.dmsexplorer.settings.Settings;
import net.mm2d.util.Log;
import net.mm2d.util.Log.Print;

/**
 * Log出力変更のための継承。
 *
 * @author <a href="mailto:ryo@mm2d.net">大前良介(OHMAE Ryosuke)</a>
 */
public class App extends Application {
    /**
     * デバッグログの出力方法。
     */
    private static class AndroidPrint implements Print {
        @Override
        public void println(int level, @NonNull String tag, @NonNull String message) {
            final String[] lines = message.split("\n");
            for (final String line : lines) {
                android.util.Log.println(level, tag, line);
            }
        }
    }

    @Override
    public void onCreate() {
        super.onCreate();
        Settings.initialize(this);
        Repository.set(new AppRepository(this));

        if (BuildConfig.DEBUG) {
            Log.setAppendCaller(true);
            Log.setLogLevel(Log.VERBOSE);
            Log.setPrint(new AndroidPrint());
            return;
        }
        Log.setLogLevel(Log.ASSERT);
        Log.setPrint((level, tag, message) -> {
        });
    }
}

@@ -203,51 +203,8 @@
 ion;
-%0Aimport android.support.annotation.NonNull;
 %0A%0Aim
@@ -327,40 +327,8 @@
 Log;
-%0Aimport net.mm2d.util.Log.Print;
 %0A%0A/*
@@ -462,399 +462,8 @@
 n %7B%0A
-    /**%0A     * %E3%83%87%E3%83%90%E3%83%83%E3%82%B0%E3%83%AD%E3%82%B0%E3%81%AE%E5%87%BA%E5%8A%9B%E6%96%B9%E6%B3%95%E3%80%82%0A     */%0A    private static class AndroidPrint implements Print %7B%0A        @Override%0A        public void println(int level, @NonNull String tag, @NonNull String message) %7B%0A            final String%5B%5D lines = message.split(%22%5Cn%22);%0A            for (final String line : lines) %7B%0A                android.util.Log.println(level, tag, line);%0A            %7D%0A        %7D%0A    %7D%0A%0A
     
@@ -755,26 +755,240 @@
 int(
-new AndroidPrint()
+(level, tag, message) -%3E %7B%0A                final String%5B%5D lines = message.split(%22%5Cn%22);%0A                for (final String line : lines) %7B%0A                    android.util.Log.println(level, tag, line);%0A                %7D%0A            %7D
 );%0A 

conver to lambda