- JavaMethod javaMethod = new JavaMethod(false, "org/slf4j/Logger", methodName, Types.PROC, Types.UNIT, Logger, Types.STRING);
- SCLValue value = new SCLValue(Name.create(getName(), methodName));
- value.setType(loggingType);
- value.setMacroRule(new MacroRule() {
- @Override
- public Expression apply(SimplificationContext context, Type[] typeParameters, EApply apply) {
- ConcreteModule module = context.getCompilationContext().module;
- String identifier;
- if (module != null)
- identifier = module.getName().replaceAll("/", ".");
- else
- identifier = CommandSession.class.getName();
- apply.set(new ELiteral(javaMethod), new Expression[] {
- new EExternalConstant(LoggerFactory.getLogger(identifier), Logger),
- apply.parameters[0]
- });
- return apply;
- }
- });
- addValue(value);
+ {
+ JavaMethod javaMethod = new JavaMethod(false, "org/slf4j/Logger", methodName, Types.PROC, Types.UNIT, Logger, Types.STRING);
+ SCLValue value = new SCLValue(Name.create(getName(), methodName));
+ value.setType(loggingType);
+ value.setMacroRule(new MacroRule() {
+ @Override
+ public Expression apply(SimplificationContext context, Type[] typeParameters, EApply apply) {
+ ConcreteModule module = context.getCompilationContext().module;
+ String identifier;
+ if (module != null)
+ identifier = module.getName().replaceAll("/", ".");
+ else
+ identifier = CommandSession.class.getName();
+ apply.set(new ELiteral(javaMethod), new Expression[] {
+ new EExternalConstant(LoggerFactory.getLogger(identifier), Logger),
+ apply.parameters[0]
+ });
+ return apply;
+ }
+ });
+ addValue(value);
+ }
+ {
+ JavaMethod javaMethod = new JavaMethod(false, "org/slf4j/Logger", methodName, Types.PROC, Types.UNIT, Logger, Types.STRING, Throwable);
+ SCLValue value = new SCLValue(Name.create(getName(), methodName + "E"));
+ value.setType(loggingTypeWithException);
+ value.setMacroRule(new MacroRule() {
+ @Override
+ public Expression apply(SimplificationContext context, Type[] typeParameters, EApply apply) {
+ ConcreteModule module = context.getCompilationContext().module;
+ String identifier;
+ if (module != null)
+ identifier = module.getName().replaceAll("/", ".");
+ else
+ identifier = CommandSession.class.getName();
+ apply.set(new ELiteral(javaMethod), new Expression[] {
+ new EExternalConstant(LoggerFactory.getLogger(identifier), Logger),
+ apply.parameters[0],
+ apply.parameters[1]
+ });
+ return apply;
+ }
+ });
+ addValue(value);
+ }