mirror of
https://github.com/cekis/swg-api
synced 2026-07-14 06:01:38 -04:00
Added negating to log filters
This commit is contained in:
@@ -763,7 +763,7 @@ public class SwgConfiguration {
|
||||
|
||||
public String toString() {
|
||||
StringBuilder output = new StringBuilder(type + ":" + path);
|
||||
if(filters != null) {
|
||||
if(filters != null && filters.size() > 0) {
|
||||
int filterSize = filters.size();
|
||||
output.append("{");
|
||||
for (int i = 0; i < filterSize; i++) {
|
||||
@@ -777,13 +777,14 @@ public class SwgConfiguration {
|
||||
|
||||
public static class LogTargetFilter {
|
||||
private String type;
|
||||
private String name;
|
||||
private String match;
|
||||
private boolean negate;
|
||||
private boolean filtered;
|
||||
|
||||
LogTargetFilter() {}
|
||||
|
||||
public String toString() {
|
||||
return getTypeValue() + getFilteredValue() + name;
|
||||
return getTypeValue() + getFilteredValue() + (isNegate() ? "!" : "") + match;
|
||||
}
|
||||
|
||||
private String getTypeValue() {
|
||||
@@ -799,8 +800,10 @@ public class SwgConfiguration {
|
||||
}
|
||||
|
||||
private String getFilteredValue() {
|
||||
if(isFiltered()) return "-";
|
||||
return "+";
|
||||
if(isFiltered()) {
|
||||
return isNegate() ? "+" : "-";
|
||||
}
|
||||
return isNegate() ? "-" : "+";
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
@@ -811,12 +814,20 @@ public class SwgConfiguration {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
public String getMatch() {
|
||||
return match;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
public void setMatch(String match) {
|
||||
this.match = match;
|
||||
}
|
||||
|
||||
public boolean isNegate() {
|
||||
return negate;
|
||||
}
|
||||
|
||||
public void setNegate(boolean negate) {
|
||||
this.negate = negate;
|
||||
}
|
||||
|
||||
public boolean isFiltered() {
|
||||
|
||||
Reference in New Issue
Block a user