Skip to content

Reduce amount of log junk emitted #1286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public void execute() throws MojoExecutionException {
for (Entry<String, String> entry : providerImplementations.entrySet()) {
String providerType = entry.getKey();
String providerImplementation = entry.getValue();
getLog().info("Change the default '" + providerType + "' provider implementation to '"
getLog().debug("Change the default '" + providerType + "' provider implementation to '"
+ providerImplementation + "'.");
getScmManager().setScmProviderImplementation(providerType, providerImplementation);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void execute() throws MojoExecutionException {
ScmProvider provider = getScmManager().getProviderByRepository(repository);

String finalBranch = provider.sanitizeTagName(branch);
getLog().info("Final Branch Name: '" + finalBranch + "'");
getLog().debug("Final Branch Name: '" + finalBranch + "'");

ScmBranchParameters scmBranchParameters = new ScmBranchParameters(message);
scmBranchParameters.setRemoteBranching(remoteBranching);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public void execute() throws MojoExecutionException {
ChangeLogSet changeLogSet = result.getChangeLog();

for (ChangeSet changeSet : changeLogSet.getChangeSets()) {
getLog().info(changeSet.toString());
getLog().debug(changeSet.toString());
}

} catch (IOException | ScmException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ protected ScmResult checkout() throws MojoExecutionException {

private void prepareOutputDirectory(File ouputDirectory) throws MojoExecutionException {
try {
this.getLog().info("Removing " + ouputDirectory);
this.getLog().debug("Removing " + ouputDirectory);

FileUtils.deleteDirectory(getCheckoutDirectory());
} catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public void execute() throws MojoExecutionException {

checkResult(result);

getLog().info(result.getPatch());
getLog().debug(result.getPatch());

try {
if (outputFile != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ protected void export() throws MojoExecutionException {

try {
if (this.exportDirectory.exists()) {
this.getLog().info("Removing " + this.exportDirectory);
this.getLog().debug("Removing " + this.exportDirectory);

FileUtils.deleteDirectory(this.exportDirectory);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ public void execute() throws MojoExecutionException {

if (addTimestamp) {
try {
getLog().info("Using timestamp pattern '" + timestampFormat + "'");
getLog().debug("Using timestamp pattern '" + timestampFormat + "'");
dateFormat = new SimpleDateFormat(timestampFormat);
tagTimestamp = dateFormat.format(new Date());
getLog().info("Using timestamp '" + tagTimestamp + "'");
getLog().debug("Using timestamp '" + tagTimestamp + "'");
} catch (IllegalArgumentException e) {
String msg = "The timestamp format '" + timestampFormat + "' is invalid.";
getLog().error(msg, e);
Expand All @@ -152,7 +152,7 @@ public void execute() throws MojoExecutionException {
ScmProvider provider = getScmManager().getProviderByRepository(repository);

finalTag = provider.sanitizeTagName(finalTag);
getLog().info("Final Tag Name: '" + finalTag + "'");
getLog().debug("Final Tag Name: '" + finalTag + "'");

ScmTagParameters scmTagParameters = new ScmTagParameters(message);
scmTagParameters.setRemoteTagging(remoteTagging);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void execute() throws MojoExecutionException {
if (result instanceof UpdateScmResultWithRevision) {
String revision = ((UpdateScmResultWithRevision) result).getRevision();

getLog().info("Storing revision in '" + revisionKey + "' project property.");
getLog().debug("Storing revision in '" + revisionKey + "' project property.");

if (project.getProperties() != null) // Remove the test when we'll use plugin-test-harness 1.0-alpha-2
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ protected CheckOutScmResult executeCheckOutCommand(

File checkoutDir = fileSet.getBasedir();
try {
if (logger.isInfoEnabled()) {
logger.info("Removing " + checkoutDir);
if (logger.isDebugEnabled()) {
logger.debug("Removing " + checkoutDir);
}
FileUtils.deleteDirectory(checkoutDir);
} catch (IOException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,17 @@ public void doConsume(ScmFileStatus status, String trimmedLine) {
// Only include real files (not directories)
File tmpFile = new File(workingDir, trimmedLine);
if (!tmpFile.exists()) {
if (logger.isInfoEnabled()) {
logger.info("Not a file: " + tmpFile + ". Ignoring");
if (logger.isDebugEnabled()) {
logger.debug("Not a file: " + tmpFile + ". Ignoring");
}
} else if (tmpFile.isDirectory()) {
if (logger.isInfoEnabled()) {
logger.info("New directory added: " + tmpFile);
if (logger.isDebugEnabled()) {
logger.debug("New directory added: " + tmpFile);
}
} else {
ScmFile scmFile = new ScmFile(trimmedLine, status);
if (logger.isInfoEnabled()) {
logger.info(scmFile.toString());
if (logger.isDebugEnabled()) {
logger.debug(scmFile.toString());
}
repositoryStatus.add(scmFile);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public CheckInScmResult executeCommand(ScmProviderRepository repo, ScmFileSet fi
.setSign(parameters.getBoolean(CommandParameter.SCM_COMMIT_SIGN, true));
RevCommit commitRev = command.call();

logger.info("commit done: " + commitRev.getShortMessage());
logger.debug("commit done: " + commitRev.getShortMessage());
checkedInFiles = JGitUtils.getFilesInCommit(git.getRepository(), commitRev, fileSet.getBasedir());
if (logger.isDebugEnabled()) {
for (ScmFile scmFile : checkedInFiles) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ public ScmResult executeUntagCommand(

CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();

if (logger.isInfoEnabled()) {
logger.info("Executing: " + SvnCommandLineUtils.cryptPassword(cl));
if (logger.isDebugEnabled()) {
logger.debug("Executing: " + SvnCommandLineUtils.cryptPassword(cl));

if (Os.isFamily(Os.FAMILY_WINDOWS)) {
logger.info("Working directory: " + cl.getWorkingDirectory().getAbsolutePath());
logger.debug("Working directory: " + cl.getWorkingDirectory().getAbsolutePath());
}
}

Expand Down
Loading