private int readSourceToLog(Settings settings){
  String sourceToLog=settings.get(INDEX_INDEXING_SLOWLOG_MAX_SOURCE_CHARS_TO_LOG,"1000");
  try {
    return Integer.parseInt(sourceToLog,10);
  }
 catch (  NumberFormatException e) {
    return Booleans.parseBoolean(sourceToLog,true) ? Integer.MAX_VALUE : 0;
  }
}

private int readSourceToLog ( Settings settings ) { String sourceToLog = settings . get ( INDEX_INDEXING_SLOWLOG_MAX_SOURCE_CHARS_TO_LOG , "1000" ) ; try { return Integer . parseInt ( sourceToLog , 10 ) ; } catch ( NumberFormatException e ) { return Booleans . parseBoolean ( sourceToLog , true ) ? Integer . MAX_VALUE : 0 ; } }
reads how much of the source to log . the user can specify any value they like and numbers are interpreted the maximum number of characters to log and everything else is interpreted as elasticsearch interprets booleans which is then converted to 0 for false and integer . max_value for true .
