Skip to content

Commit

Permalink
PullReqeust for #99 and #63 + logDebugFunction instead of system.out.…
Browse files Browse the repository at this point in the history
…println
  • Loading branch information
S L committed Mar 6, 2014
1 parent e1df953 commit f15999d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/pl/project13/maven/git/GitCommitIdMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,8 @@ public void execute() throws MojoExecutionException {
prefixDot = prefix + ".";

loadGitData(properties);
filterNot(properties, excludeProperties);
loadBuildTimeData(properties);
filterNot(properties, excludeProperties);
logProperties(properties);

if (generateGitPropertiesFile) {
Expand All @@ -316,7 +316,7 @@ public void execute() throws MojoExecutionException {
if (injectAllReactorProjects) {
appendPropertiesToReactorProjects(properties);
}
} catch (IOException e) {
} catch (Exception e) {
handlePluginFailure(e);
}

Expand All @@ -340,7 +340,7 @@ public Predicate<CharSequence> apply(String exclude) {

for (String key : properties.stringPropertyNames()) {
if (shouldExclude.apply(key)) {
System.out.println("shouldExclude.apply(" + key +") = " + shouldExclude.apply(key));
loggerBridge.debug("shouldExclude.apply(" + key +") = " + shouldExclude.apply(key));
properties.remove(key);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/main/java/pl/project13/maven/git/log/LoggerBridge.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
public interface LoggerBridge {
void log(Object... parts);
void error(Object... parts);
void debug(Object... parts);
void setVerbose(boolean verbose);
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ public void error(Object... parts) {
logger.error(Joiner.on(" ").join(parts));
}
}

@Override
public void debug(Object... parts) {
if (verbose) {
logger.debug(Joiner.on(" ").join(parts));
}
}

@Override
public void setVerbose(boolean verbose) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ public void error(Object... parts) {
System.out.println("ERR: " + Joiner.on(" ").join(parts));
}
}

@Override
public void debug(Object... parts) {
if(verbose) {
System.out.println("DBG: " + Joiner.on(" ").join(parts));
}
}

@Override
public void setVerbose(boolean verbose) {
Expand Down

0 comments on commit f15999d

Please sign in to comment.