usbshare/src/main/java/dev/luoei/app/tool/usb/share/LogService.java
// 500K averages to a 4000 lines per file
500K averages to a 4000 lines per file
500K averages to a 4000 lines per file
public static void initLogger(){
        String diskPath = Environment.getExternalStorageDirectory().getAbsolutePath();
        String folder = diskPath + File.separatorChar + "logger/usbshare";
        HandlerThread ht = new HandlerThread("AndroidFileLogger." + folder);
        ht.start();
        Handler handler = new DiskLogStrategy.WriteHandler(ht.getLooper(), folder, MAX_BYTES);
        DiskLogStrategy logStrategy = new DiskLogStrategy(handler);
        FormatStrategy formatStrategy = CsvFormatStrategy.newBuilder()
                .tag("USB")
                .logStrategy(logStrategy)
                .build();
        Logger.addLogAdapter(new DiskLogAdapter(formatStrategy));
        Logger.addLogAdapter(new AndroidLogAdapter());
    }
public static void initLogger ( ) { String diskPath = Environment . getExternalStorageDirectory ( ) . getAbsolutePath ( ) ; String folder = diskPath + File . separatorChar + "logger/usbshare" ; HandlerThread ht = new HandlerThread ( "AndroidFileLogger." + folder ) ; ht . start ( ) ; Handler handler = new DiskLogStrategy . WriteHandler ( ht . getLooper ( ) , folder , MAX_BYTES ) ; DiskLogStrategy logStrategy = new DiskLogStrategy ( handler ) ; FormatStrategy formatStrategy = CsvFormatStrategy . newBuilder ( ) . tag ( "USB" ) . logStrategy ( logStrategy ) . build ( ) ; Logger . addLogAdapter ( new DiskLogAdapter ( formatStrategy ) ) ; Logger . addLogAdapter ( new AndroidLogAdapter ( ) ) ; }
500K averages to a 4000 lines per file
500K averages to a 4000 lines per file