private void cleanLogFilesIfNecessary() {
        File logDir = new File(folderPath);
        File[] files = logDir.listFiles();
        if (files == null) {
            return;
        }
        for (File file : files) {
            if (cleanStrategy.shouldClean(file)) {
                file.delete();
            }
        }
    }
Clean log files if should clean follow strategy
android/android_framework/base/src/main/java/com/elvishew/xlog/printer/file/FilePrinter.java