/** * Create the Cargo logger that will be used for logging all messages. If the user has specified * a log file we create a File logger. If no file has been specified we use an Ant logger by * default to log to the Ant logging subsystem. */ private void createCargoLogger() { if (getLog() != null) { this.logger = new FileLogger(getLog(), true); } else { // Use an Ant logger adapter to log to Ant this.logger = new AntLogger(getProject()); } if (getLogLevel() != null) { this.logger.setLevel(getLogLevel()); } else { this.logger.setLevel(LogLevel.INFO); } }
/** * Create the Cargo logger that will be used for logging all messages. If the user has specified * a log file we create a File logger. If no file has been specified we use an Ant logger by * default to log to the Ant logging subsystem. */ private void createCargoLogger() { if (getLog() != null) { this.logger = new FileLogger(getLog(), true); } else { // Use an Ant logger adapter to log to Ant this.logger = new AntLogger(getProject()); } if (getLogLevel() != null) { this.logger.setLevel(getLogLevel()); } else { this.logger.setLevel(LogLevel.INFO); } }
/** * Initializes the test case. * @param testName Test name. * @param testData Test environment data. * @throws Exception If anything goes wrong. */ public AbstractCargoTestCase(String testName, EnvironmentTestData testData) throws Exception { super(testName); // Save the testData for use by TestCases extending this class this.testData = testData; // Ensure target dir exists so that we can create the log file File targetDir = new File(getTestData().targetDir); targetDir.mkdirs(); if (!targetDir.isDirectory()) { fail("Directory " + targetDir + " does not exist"); } this.logger = new FileLogger(new File(targetDir.getParentFile(), "cargo.log"), true); this.logger.setLevel(LogLevel.DEBUG); }