use of org.metaborg.util.log.Level in project nabl by metaborg.
the class StatixPrimitive method getDebugContext.
protected IDebugContext getDebugContext(ITerm levelTerm) throws InterpreterException {
final String levelString = M.stringValue().match(levelTerm).orElseThrow(() -> new InterpreterException("Expected log level."));
@Nullable final Level level = levelString.equalsIgnoreCase("None") ? null : Level.parse(levelString);
final IDebugContext debug = level != null ? new LoggerDebugContext(getLogger(), level) : new NullDebugContext();
return debug;
}
Aggregations