+ { // logging function with two parameters :: Marker -> String -> <Proc> ()
+ JavaMethod javaMethod = new JavaMethod(false, "org/slf4j/Logger", methodName, Types.PROC, Types.UNIT, Logger, Marker, Types.STRING);
+ SCLValue value = new SCLValue(Name.create(getName(), methodName + "M"));
+ value.setType(loggingTypeWithMarker);
+ value.setMacroRule(new MacroRule() {
+ @Override
+ public Expression apply(SimplificationContext context, Type[] typeParameters, EApply apply) {
+ String identifier = resolveModuleIdentifier(context.getCompilationContext());
+ apply.set(new ELiteral(javaMethod), new Expression[] {
+ new EExternalConstant(LoggerFactory.getLogger(identifier), Logger),
+ apply.parameters[0],
+ apply.parameters[1]
+ });
+ return apply;
+ }
+ });
+ addValue(value);
+ }
+ { // logging function with three parameters :: Marker -> String -> Throwable -> <Proc> ()
+ JavaMethod javaMethod = new JavaMethod(false, "org/slf4j/Logger", methodName, Types.PROC, Types.UNIT, Logger, Marker, Types.STRING, Throwable);
+ SCLValue value = new SCLValue(Name.create(getName(), methodName + "ME"));
+ value.setType(loggingTypeWithMarkerAndException);
+ value.setMacroRule(new MacroRule() {
+ @Override
+ public Expression apply(SimplificationContext context, Type[] typeParameters, EApply apply) {
+ String identifier = resolveModuleIdentifier(context.getCompilationContext());
+ apply.set(new ELiteral(javaMethod), new Expression[] {
+ new EExternalConstant(LoggerFactory.getLogger(identifier), Logger),
+ apply.parameters[0],
+ apply.parameters[1],
+ apply.parameters[2]
+ });
+ return apply;
+ }
+ });
+ addValue(value);
+ }