jvpp: added logs for sending and receiving event messages (VPP-982)
[vpp.git] / src / vpp-api / java / jvpp / gen / jvppgen / jvpp_impl_gen.py
index 7bf9113..7af70be 100644 (file)
@@ -49,6 +49,7 @@ import java.nio.file.attribute.PosixFilePermission;
 import java.nio.file.attribute.PosixFilePermissions;
 import java.util.Set;
 import java.util.logging.Logger;
+import java.util.logging.Level;
 import $base_package.callback.JVppCallback;
 import $base_package.VppConnection;
 import $base_package.JVppRegistry;
@@ -139,6 +140,9 @@ method_native_template = Template(
 method_impl_template = Template("""    public final int $name($plugin_package.$dto_package.$request request) throws io.fd.vpp.jvpp.VppInvocationException {
         java.util.Objects.requireNonNull(request,"Null request object");
         connection.checkActive();
+        if(LOG.isLoggable(Level.FINE)) {
+            LOG.fine(String.format("Sending $name event message: %s", request));
+        }
         int result=${name}0(request);
         if(result<0){
             throw new io.fd.vpp.jvpp.VppInvocationException("${name}",result);
@@ -151,6 +155,7 @@ no_arg_method_template = Template("""    int $name() throws io.fd.vpp.jvpp.VppIn
 no_arg_method_native_template = Template("""    private static native int ${name}0() throws io.fd.vpp.jvpp.VppInvocationException;""")
 no_arg_method_impl_template = Template("""    public final int $name() throws io.fd.vpp.jvpp.VppInvocationException {
         connection.checkActive();
+        LOG.fine("Sending $name event message");
         int result=${name}0();
         if(result<0){
             throw new io.fd.vpp.jvpp.VppInvocationException("${name}",result);