Skip to content
Merged
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 @@ -17,6 +17,7 @@
*/
package org.owasp.dependencycheck.ant.logging;

import java.util.Objects;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.slf4j.Logger;
Expand All @@ -40,11 +41,20 @@ public class AntLoggerAdapter implements Logger {
/**
* The logger name.
*/
private static final String NAME = "dependency-check-ant";
private final String name;

/**
* Constructor.
*
* @param name the logger name
*/
public AntLoggerAdapter(String name) {
this.name = Objects.requireNonNull(name, "Logger name cannot be null");
}

@Override
public String getName() {
return NAME;
return name;
}

private Task task() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,14 @@
*/
public class AntLoggerFactory implements ILoggerFactory {

/**
* A reference to the Ant logger Adapter.
*/
private final AntLoggerAdapter antLoggerAdapter = new AntLoggerAdapter();

/**
* Returns the Ant logger adapter.
*
* @param name ignored in this implementation
* @param name the logger name
* @return the Ant logger adapter
*/
@Override
public Logger getLogger(String name) {
return antLoggerAdapter;
return new AntLoggerAdapter(name);
}
}