All Downloads are FREE. Search and download functionalities are using the official Maven repository.

delombok.io.github.qsy7.logging.plugin.advice.FieldContextualExceptionAdvice Maven / Gradle / Ivy

There is a newer version: 0.3.3
Show newest version
// Generated by delombok at Fri Jan 12 23:25:53 EST 2024
package io.github.qsy7.logging.plugin.advice;

import io.github.qsy7.logging.enumeration.LogLevel;
import io.github.qsy7.logging.util.ContextualDataUtil;
import io.github.qsy7.logging.util.ExceptionUtil;
import net.bytebuddy.asm.Advice;
import org.slf4j.LoggerFactory;
// TODO: not presently used
public class FieldContextualExceptionAdvice {
  @Advice.OnMethodExit(onThrowable = Throwable.class)
  public static void onException(@Advice.This final Object intercepted, @Advice.Origin("#t") final String typeName, @Advice.Origin("#m") final String methodName, @Advice.AllArguments Object[] arguments, @Advice.Thrown Throwable throwable) {
    if (throwable == null) {
      return;
    }
    ExceptionUtil.onException(typeName, methodName, arguments, throwable);
    LogLevel.ERROR.log(LoggerFactory.getLogger(typeName), "Contextual Details:\n{}", ContextualDataUtil.getContextualData(intercepted));
  }

  @java.lang.SuppressWarnings("all")
  private FieldContextualExceptionAdvice() {
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy