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> <dependency>
<groupId>ch.qos.logback</groupId> <groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId> <artifactId>logback-classic</artifactId>
<version>0.9.28</version> <version>0.9.29</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>

View File

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

View File

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

View File

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