Tabnine Logo
BatfishLogger.getHistory
Code IndexAdd Tabnine to your IDE (free)

How to use
getHistory
method
in
org.batfish.common.BatfishLogger

Best Java code snippets using org.batfish.common.BatfishLogger.getHistory (Showing top 10 results out of 315)

origin: batfish/batfish

@Override
public final NodJobResult call() {
 long startTime = System.currentTimeMillis();
 try (Context ctx = new Context()) {
  SmtInput smtInput = computeSmtInput(startTime, ctx);
  Map<IngressLocation, Map<String, Long>> ingressLocationConstraints =
    getSolutionPerIngressLocation(ctx, smtInput);
  Set<Flow> flows = getFlows(ingressLocationConstraints);
  return new NodJobResult(startTime, _logger.getHistory(), flows);
 } catch (Z3Exception e) {
  return new NodJobResult(
    startTime,
    _logger.getHistory(),
    new BatfishException("Error running NoD on concatenated data plane", e));
 }
}
origin: batfish/batfish

  elapsedTime = System.currentTimeMillis() - startTime;
  return new FlattenVendorConfigurationResult(
    elapsedTime, _logger.getHistory(), _outputFile, new BatfishException(error, e));
 } catch (Exception e) {
  String error =
  elapsedTime = System.currentTimeMillis() - startTime;
  return new FlattenVendorConfigurationResult(
    elapsedTime, _logger.getHistory(), _outputFile, new BatfishException(error, e));
 } finally {
  Batfish.logWarnings(_logger, _warnings);
   elapsedTime, _logger.getHistory(), _outputFile, flatConfigText);
} else if (!_settings.ignoreUnsupported() && format == ConfigurationFormat.UNKNOWN) {
 elapsedTime = System.currentTimeMillis() - startTime;
 return new FlattenVendorConfigurationResult(
   elapsedTime,
   _logger.getHistory(),
   _outputFile,
   new BatfishException("Unknown configuration format for: \"" + _inputFile + "\""));
 elapsedTime = System.currentTimeMillis() - startTime;
 return new FlattenVendorConfigurationResult(
   elapsedTime, _logger.getHistory(), _outputFile, flatConfigText);
origin: batfish/batfish

private void checkProcessCommandErrorMessage(
  Command command, String[] parameters, String expected) throws Exception {
 Client client = new Client(new String[] {"-runmode", "gendatamodel"});
 File tempFile = _folder.newFile("writer");
 FileWriter writer = new FileWriter(tempFile);
 client._logger = new BatfishLogger("output", false);
 String[] args = ArrayUtils.addAll(new String[] {command.commandName()}, parameters);
 assertFalse(client.processCommand(args, writer));
 assertThat(client.getLogger().getHistory().toString(500), equalTo(expected));
 writer.close();
}
origin: batfish/batfish

  elapsedTime = System.currentTimeMillis() - startTime;
  return new ParseEnvironmentBgpTableResult(
    elapsedTime, _logger.getHistory(), _file, _warnings, ParseStatus.EMPTY);
   elapsedTime = System.currentTimeMillis() - startTime;
   return new ParseEnvironmentBgpTableResult(
     elapsedTime, _logger.getHistory(), _file, new BatfishException(unknownError));
  } else {
   _warnings.unimplemented(unknownError);
   elapsedTime = System.currentTimeMillis() - startTime;
   return new ParseEnvironmentBgpTableResult(
     elapsedTime, _logger.getHistory(), _file, _warnings, ParseStatus.UNKNOWN);
  elapsedTime = System.currentTimeMillis() - startTime;
  return new ParseEnvironmentBgpTableResult(
    elapsedTime, _logger.getHistory(), _file, new BatfishException(unsupportedError));
 } else {
  _warnings.unimplemented(unsupportedError);
  elapsedTime = System.currentTimeMillis() - startTime;
  return new ParseEnvironmentBgpTableResult(
    elapsedTime, _logger.getHistory(), _file, _warnings, ParseStatus.UNSUPPORTED);
 elapsedTime = System.currentTimeMillis() - startTime;
 return new ParseEnvironmentBgpTableResult(
   elapsedTime, _logger.getHistory(), _file, new BatfishException(error, e));
} catch (Exception e) {
 String error =
 elapsedTime = System.currentTimeMillis() - startTime;
origin: batfish/batfish

private void testProcessCommandWithValidInput(
  Command command, String[] parameters, String expected) throws Exception {
 Client client = new Client(new String[] {"-runmode", "gendatamodel"});
 File tempFile = _folder.newFile("writer");
 FileWriter writer = new FileWriter(tempFile);
 String[] args = ArrayUtils.addAll(new String[] {command.commandName()}, parameters);
 client._logger = new BatfishLogger("output", false);
 assertTrue(client.processCommand(args, writer));
 assertThat(client.getLogger().getHistory().toString(500), equalTo(expected));
 writer.close();
}
origin: batfish/batfish

  elapsedTime = System.currentTimeMillis() - startTime;
  return new ParseEnvironmentRoutingTableResult(
    elapsedTime, _logger.getHistory(), _file, _warnings, ParseStatus.EMPTY);
   elapsedTime = System.currentTimeMillis() - startTime;
   return new ParseEnvironmentRoutingTableResult(
     elapsedTime, _logger.getHistory(), _file, new BatfishException(unknownError));
  } else {
   _warnings.unimplemented(unknownError);
   elapsedTime = System.currentTimeMillis() - startTime;
   return new ParseEnvironmentRoutingTableResult(
     elapsedTime, _logger.getHistory(), _file, _warnings, ParseStatus.UNKNOWN);
 elapsedTime = System.currentTimeMillis() - startTime;
 return new ParseEnvironmentRoutingTableResult(
   elapsedTime, _logger.getHistory(), _file, new BatfishException(error, e));
} catch (Exception e) {
 String error =
 elapsedTime = System.currentTimeMillis() - startTime;
 return new ParseEnvironmentRoutingTableResult(
   elapsedTime, _logger.getHistory(), _file, new BatfishException(error, e));
} finally {
 Batfish.logWarnings(_logger, _warnings);
elapsedTime = System.currentTimeMillis() - startTime;
return new ParseEnvironmentRoutingTableResult(
  elapsedTime, _logger.getHistory(), _file, _hostname, routesByVrf, _warnings, _ptSentences);
origin: batfish/batfish

@Test
public void testDefaultCase() throws Exception {
 Client client = new Client(new String[] {"-runmode", "gendatamodel"});
 File tempFile = _folder.newFile("writer");
 FileWriter writer = new FileWriter(tempFile);
 client._logger = new BatfishLogger("output", false);
 String[] args = new String[] {"non-exist command"};
 String expected = "Command failed: Not a valid command: \"non-exist command\"\n";
 assertFalse(client.processCommand(args, writer));
 assertThat(client.getLogger().getHistory().toString(500), equalTo(expected));
}
origin: batfish/batfish

 elapsedTime = System.currentTimeMillis() - startTime;
 return new ConvertConfigurationResult(
   elapsedTime, _logger.getHistory(), _name, new BatfishException(error, e));
} finally {
 warningsByHost.forEach((hostname, warnings) -> Batfish.logWarnings(_logger, warnings));
  elapsedTime, _logger.getHistory(), warningsByHost, _name, configurations, answerElement);
origin: batfish/batfish

return new ParseVendorConfigurationResult(
  System.currentTimeMillis() - startTime,
  _logger.getHistory(),
  _filename,
  _warnings,
return new ParseVendorConfigurationResult(
  System.currentTimeMillis() - startTime,
  _logger.getHistory(),
  _filename,
  _warnings,
  return new ParseVendorConfigurationResult(
    System.currentTimeMillis() - startTime,
    _logger.getHistory(),
    _filename,
    new BatfishException("Error preprocessing banner", e));
 return new ParseVendorConfigurationResult(
   System.currentTimeMillis() - startTime,
   _logger.getHistory(),
   _filename,
   new BatfishException(
  _logger.getHistory(),
  _filename,
  vc,
 return new ParseVendorConfigurationResult(
origin: batfish/batfish

@Test
public void testLoadQuestionsNames() throws Exception {
 Client client =
   new Client(new String[] {"-runmode", "gendatamodel", "-prettyanswers", "false"});
 JSONObject testQuestion = new JSONObject();
 testQuestion.put(
   "instance",
   new JSONObject()
     .put("instanceName", "testQuestionName")
     .put("description", "test question description"));
 Path questionJsonPath = _folder.newFile("testquestion.json").toPath();
 CommonUtil.writeFile(questionJsonPath, testQuestion.toString());
 client._logger = new BatfishLogger("output", false);
 client.processCommand(
   new String[] {LOAD_QUESTIONS.commandName(), questionJsonPath.getParent().toString()}, null);
 // Reading the answer written by load-questions
 Answer answerLoadQuestions =
   _mapper.readValue(
     client.getLogger().getHistory().toString(BatfishLogger.LEVEL_OUTPUT), Answer.class);
 LoadQuestionAnswerElement ae =
   (LoadQuestionAnswerElement) answerLoadQuestions.getAnswerElements().get(0);
 // Checking that question name in answer element matches instanceName in file
 assertEquals("testQuestionName", ae.getAdded().first());
}
org.batfish.commonBatfishLoggergetHistory

Popular methods of BatfishLogger

  • <init>
  • debugf
  • errorf
  • info
  • error
  • infof
  • warnf
  • debug
  • getLogLevel
  • getLogLevelStr
  • output
  • append
  • output,
  • append,
  • isActive,
  • setLogLevel,
  • warn,
  • close,
  • getElapsedTime,
  • getPrintStream,
  • getRotatedLogFilename

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • setRequestProperty (URLConnection)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now