public synchronized File getLogFile() {

        File dir = getStorageDir();
        if (dir == null) {
            Log.e(TAG, "Unable to open log file from external storage");
            return null;
        }

        switch (wraper.nameFormat) {
            case WrapFormatter.NAME_FORMAT_DATE: {
                String file = getFormattedNameWithDate(dir);
                mLogFile = new File(dir, file);
            }
            break;
            case WrapFormatter.NAME_FORMAT_PLUSINDEX: {
                String file = getFormattedNameWithPlusIndex(dir);
                mLogFile = new File(dir, file);
            }
            break;
            case WrapFormatter.NAME_FORMAT_NONE: {
                mLogFile = new File(dir, getFileName(fileName).concat(DEFUALT_FILE_EXT));
            }
            break;
            default: {
                mLogFile = new File(dir, getFileName(fileName).concat(DEFUALT_FILE_EXT));
            }
            break;
        }

        try {
            mLogFile.getParentFile().mkdirs();
            mLogFile.createNewFile();
        } catch (IOException e) {
            Log.e(TAG, "创建文件失败了..." + e.toString() + " mLogFile.getParentFile()");
        }

        return mLogFile;
    }
public synchronized File getLogFile ( ) { File dir = getStorageDir ( ) ; if ( dir == null ) { Log . e ( TAG , "Unable to open log file from external storage" ) ; return null ; } switch ( wraper . nameFormat ) { case WrapFormatter . NAME_FORMAT_DATE : { String file = getFormattedNameWithDate ( dir ) ; mLogFile = new File ( dir , file ) ; } break ; case WrapFormatter . NAME_FORMAT_PLUSINDEX : { String file = getFormattedNameWithPlusIndex ( dir ) ; mLogFile = new File ( dir , file ) ; } break ; case WrapFormatter . NAME_FORMAT_NONE : { mLogFile = new File ( dir , getFileName ( fileName ) . concat ( DEFUALT_FILE_EXT ) ) ; } break ; default : { mLogFile = new File ( dir , getFileName ( fileName ) . concat ( DEFUALT_FILE_EXT ) ) ; } break ; } try { mLogFile . getParentFile ( ) . mkdirs ( ) ; mLogFile . createNewFile ( ) ; } catch ( IOException e ) { Log . e ( TAG , "创建文件失败了..." + e . toString ( ) + " mLogFile.getParentFile()" ) ; } return mLogFile ; }
if the file hasn't been settled, will auto set to external storage.

@return the log file used to log to external storage