MCPcopy Create free account
hub / github.com/BaseXdb/basex / noTargets

Method noTargets

basex-core/src/main/java/org/basex/util/log/Log.java:172–192  ·  view source on GitHub ↗

Checks if logging is requested. Initializes the log targets if not done yet (not part of the constructor to consider command-line arguments). @return result of check

()

Source from the content-addressed store, hash-verified

170 * @return result of check
171 */
172 private boolean noTargets() {
173 if(targets == null) {
174 final String log = sopts.get(StaticOptions.LOG);
175 final Set<LogTarget> set = EnumSet.noneOf(LogTarget.class);
176 for(final String target : log.trim().toUpperCase(Locale.ENGLISH).split("\\s*,\\s*")) {
177 final Boolean enable = Strings.toBoolean(target);
178 if(enable == null) {
179 for(final LogTarget lt : LogTarget.values()) {
180 if(target.equals(lt.name())) set.add(lt);
181 }
182 } else if(enable) {
183 set.add(LogTarget.DATA);
184 } else {
185 set.clear();
186 break;
187 }
188 }
189 targets = set;
190 }
191 return targets.isEmpty();
192 }
193
194 /**
195 * Checks if a log entry is filtered out.

Callers 1

writeMethod · 0.95

Calls 10

toBooleanMethod · 0.95
getMethod · 0.65
nameMethod · 0.65
addMethod · 0.65
splitMethod · 0.45
trimMethod · 0.45
valuesMethod · 0.45
equalsMethod · 0.45
clearMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected