toned down logging and corrected logback version

This commit is contained in:
Adrian Cole 2011-07-25 13:47:11 -07:00
parent a6351972d4
commit 46c147d43b
4 changed files with 10 additions and 6 deletions

View File

@ -91,7 +91,7 @@
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>0.9.28</version>
<version>0.9.29</version>
<scope>test</scope>
</dependency>
</dependencies>

View File

@ -137,7 +137,10 @@ public class RunScriptOnNodeAsInitScriptUsingSsh implements RunScriptOnNode {
ssh.put(initFile, init.render(OsFamily.UNIX));
} catch (SshException e) {
// If there's a problem with the sftp configuration, we can try via ssh exec
logger.warn(e, "<< (%s) problem using sftp [%s], attempting via sshexec", ssh.toString(), e.getMessage());
if (logger.isTraceEnabled())
logger.warn(e, "<< (%s) problem using sftp [%s], attempting via sshexec", ssh.toString(), e.getMessage());
else
logger.warn("<< (%s) problem using sftp [%s], attempting via sshexec", ssh.toString(), e.getMessage());
ssh.disconnect();
ssh.connect();
ssh.exec("rm " + initFile);
@ -206,8 +209,8 @@ public class RunScriptOnNodeAsInitScriptUsingSsh implements RunScriptOnNode {
@Override
public String toString() {
return Objects.toStringHelper(this).add("node", node).add("name", init.getInstanceName()).add("runAsRoot",
runAsRoot).toString();
return Objects.toStringHelper(this).add("node", node).add("name", init.getInstanceName())
.add("runAsRoot", runAsRoot).toString();
}
@Override

View File

@ -570,7 +570,7 @@ public class TemplateBuilderImpl implements TemplateBuilder {
}
Hardware hardware = resolveSize(hardwareSorter(), supportedImages);
Image image = resolveImage(hardware, supportedImages);
logger.debug("<< matched image(%s)", image);
logger.debug("<< matched image(%s)", image.getId());
return new TemplateImpl(image, hardware, location, options);
}
@ -614,7 +614,7 @@ public class TemplateBuilderImpl implements TemplateBuilder {
logger.warn(exception, "hardware profiles %s\nimage ids %s", hardwarel, transform(images, imageToId));
throw exception;
}
logger.debug("<< matched hardware(%s)", hardware);
logger.debug("<< matched hardware(%s)", hardware.getId());
return hardware;
}

View File

@ -139,6 +139,7 @@ public class TemplateBuilderImplTest {
expect(image2.getLocation()).andReturn(defaultLocation).atLeastOnce();
expect(image.getOperatingSystem()).andReturn(os).atLeastOnce();
expect(image2.getOperatingSystem()).andReturn(os2).atLeastOnce();
expect(image.getId()).andReturn("1");
expect(os.getArch()).andReturn("X86_32").atLeastOnce();
expect(os2.getArch()).andReturn("X86_64").atLeastOnce();