mirror of
https://github.com/cekis/swg-api
synced 2026-01-16 19:05:10 -05: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() {
|
||||
|
||||
@@ -139,16 +139,18 @@ sharedLog:
|
||||
logTargets:
|
||||
- type: net
|
||||
path: 127.0.0.1:44467
|
||||
filter:
|
||||
# - type: file
|
||||
# path: logs/log.txt
|
||||
# filters:
|
||||
# - type: channel
|
||||
# name: profile
|
||||
# filtered: true
|
||||
# - type: channel
|
||||
# name: CustomerService
|
||||
# filtered: true
|
||||
filters:
|
||||
- type: file
|
||||
path: logs/log.txt
|
||||
filters:
|
||||
- type: channel
|
||||
match: profile
|
||||
negate: true
|
||||
filtered: true
|
||||
- type: channel
|
||||
match: CustomerService
|
||||
negate: false
|
||||
filtered: true
|
||||
sharedNetwork:
|
||||
oldestUnacknowledgedTimeout: 0
|
||||
noDataTimeout: 1000000
|
||||
|
||||
Reference in New Issue
Block a user