aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp-api/java/jvpp/gen/jvppgen
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2018-01-26 11:39:27 +0100
committerDamjan Marion <dmarion.lists@gmail.com>2018-01-27 10:50:52 +0000
commit568cc60b7097299cacb4341a4a70d8ef270f51b4 (patch)
tree32c33be07b8c836d779ea0efdcae9b47836f5abe /src/vpp-api/java/jvpp/gen/jvppgen
parent2f8d8fa50175bf775f66ff15aff2cf08138ccfbd (diff)
jvpp: use Python's logging API
Change-Id: Iec437e4672af1f0d1a24458afb977ba6fbeba4ed Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'src/vpp-api/java/jvpp/gen/jvppgen')
-rw-r--r--src/vpp-api/java/jvpp/gen/jvppgen/callback_gen.py5
-rw-r--r--src/vpp-api/java/jvpp/gen/jvppgen/dto_gen.py4
-rw-r--r--src/vpp-api/java/jvpp/gen/jvppgen/jvpp_c_gen.py4
-rw-r--r--src/vpp-api/java/jvpp/gen/jvppgen/jvpp_callback_facade_gen.py5
-rw-r--r--src/vpp-api/java/jvpp/gen/jvppgen/jvpp_future_facade_gen.py5
-rw-r--r--src/vpp-api/java/jvpp/gen/jvppgen/jvpp_impl_gen.py4
-rw-r--r--src/vpp-api/java/jvpp/gen/jvppgen/notification_gen.py5
-rw-r--r--src/vpp-api/java/jvpp/gen/jvppgen/types_gen.py7
8 files changed, 21 insertions, 18 deletions
diff --git a/src/vpp-api/java/jvpp/gen/jvppgen/callback_gen.py b/src/vpp-api/java/jvpp/gen/jvppgen/callback_gen.py
index f0462158b9e..13a415595c2 100644
--- a/src/vpp-api/java/jvpp/gen/jvppgen/callback_gen.py
+++ b/src/vpp-api/java/jvpp/gen/jvppgen/callback_gen.py
@@ -49,9 +49,10 @@ public interface JVpp${plugin_name}GlobalCallback extends $base_package.$callbac
""")
-def generate_callbacks(func_list, base_package, plugin_package, plugin_name, callback_package, dto_package, inputfile):
+def generate_callbacks(func_list, base_package, plugin_package, plugin_name, callback_package, dto_package, inputfile,
+ logger):
""" Generates callback interfaces """
- print "Generating Callback interfaces"
+ logger.debug("Generating Callback interfaces for %s" % inputfile)
if not os.path.exists(callback_package):
os.mkdir(callback_package)
diff --git a/src/vpp-api/java/jvpp/gen/jvppgen/dto_gen.py b/src/vpp-api/java/jvpp/gen/jvppgen/dto_gen.py
index 158e26ef59f..035a5b49eb8 100644
--- a/src/vpp-api/java/jvpp/gen/jvppgen/dto_gen.py
+++ b/src/vpp-api/java/jvpp/gen/jvppgen/dto_gen.py
@@ -60,9 +60,9 @@ send_template = Template(""" @Override
}""")
-def generate_dtos(func_list, base_package, plugin_package, plugin_name, dto_package, inputfile):
+def generate_dtos(func_list, base_package, plugin_package, plugin_name, dto_package, inputfile, logger):
""" Generates dto objects in a dedicated package """
- print "Generating DTOs"
+ logger.debug("Generating DTOs for %s" % inputfile)
if not os.path.exists(dto_package):
os.mkdir(dto_package)
diff --git a/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_c_gen.py b/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_c_gen.py
index df1312a1308..b97a9f95435 100644
--- a/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_c_gen.py
+++ b/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_c_gen.py
@@ -366,9 +366,9 @@ $handler_registration
""")
-def generate_jvpp(func_list, plugin_name, inputfile, path):
+def generate_jvpp(func_list, plugin_name, inputfile, path, logger):
""" Generates jvpp C file """
- print "Generating jvpp C"
+ logger.debug("Generating jvpp C for %s" % inputfile)
class_cache = generate_class_cache(func_list, plugin_name)
jni_impl = generate_jni_impl(func_list, plugin_name, inputfile)
diff --git a/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_callback_facade_gen.py b/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_callback_facade_gen.py
index a365946beea..c378721c000 100644
--- a/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_callback_facade_gen.py
+++ b/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_callback_facade_gen.py
@@ -98,9 +98,10 @@ no_arg_method_impl_template = Template(""" public final void $name($plugin_pa
""")
-def generate_jvpp(func_list, base_package, plugin_package, plugin_name, dto_package, callback_package, notification_package, callback_facade_package, inputfile):
+def generate_jvpp(func_list, base_package, plugin_package, plugin_name, dto_package, callback_package,
+ notification_package, callback_facade_package, inputfile, logger):
""" Generates callback facade """
- print "Generating JVpp callback facade"
+ logger.debug("Generating JVpp callback facade for %s" % inputfile)
if os.path.exists(callback_facade_package):
util.remove_folder(callback_facade_package)
diff --git a/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_future_facade_gen.py b/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_future_facade_gen.py
index b91eca26142..c1a7f1c1799 100644
--- a/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_future_facade_gen.py
+++ b/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_future_facade_gen.py
@@ -156,9 +156,10 @@ jvpp_facade_details_callback_method_template = Template("""
""")
-def generate_jvpp(func_list, base_package, plugin_package, plugin_name, dto_package, callback_package, notification_package, future_facade_package, inputfile):
+def generate_jvpp(func_list, base_package, plugin_package, plugin_name, dto_package, callback_package,
+ notification_package, future_facade_package, inputfile, logger):
""" Generates JVpp interface and JNI implementation """
- print "Generating JVpp future facade"
+ logger.debug("Generating JVpp future facade for %s" % inputfile)
if not os.path.exists(future_facade_package):
os.mkdir(future_facade_package)
diff --git a/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_impl_gen.py b/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_impl_gen.py
index c2b8ebbf574..69eb67e8357 100644
--- a/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_impl_gen.py
+++ b/src/vpp-api/java/jvpp/gen/jvppgen/jvpp_impl_gen.py
@@ -165,9 +165,9 @@ no_arg_method_impl_template = Template(""" public final int $name() throws io
""")
-def generate_jvpp(func_list, base_package, plugin_package, plugin_name_underscore, dto_package, inputfile):
+def generate_jvpp(func_list, base_package, plugin_package, plugin_name_underscore, dto_package, inputfile, logger):
""" Generates JVpp interface and JNI implementation """
- print "Generating JVpp"
+ logger.debug("Generating JVpp interface implementation for %s" % inputfile)
plugin_name = util.underscore_to_camelcase_upper(plugin_name_underscore)
methods = []
diff --git a/src/vpp-api/java/jvpp/gen/jvppgen/notification_gen.py b/src/vpp-api/java/jvpp/gen/jvppgen/notification_gen.py
index 72a32469460..2008a42297e 100644
--- a/src/vpp-api/java/jvpp/gen/jvppgen/notification_gen.py
+++ b/src/vpp-api/java/jvpp/gen/jvppgen/notification_gen.py
@@ -123,9 +123,10 @@ public interface ${plugin_name}EventRegistryProvider extends $base_package.$noti
""")
-def generate_notification_registry(func_list, base_package, plugin_package, plugin_name, notification_package, callback_package, dto_package, inputfile):
+def generate_notification_registry(func_list, base_package, plugin_package, plugin_name, notification_package,
+ callback_package, dto_package, inputfile, logger):
""" Generates notification registry interface and implementation """
- print "Generating Notification interfaces and implementation"
+ logger.debug("Generating Notification interfaces and implementation for %s" % inputfile)
if not os.path.exists(notification_package):
os.mkdir(notification_package)
diff --git a/src/vpp-api/java/jvpp/gen/jvppgen/types_gen.py b/src/vpp-api/java/jvpp/gen/jvppgen/types_gen.py
index 858ea8baae7..c655933ddea 100644
--- a/src/vpp-api/java/jvpp/gen/jvppgen/types_gen.py
+++ b/src/vpp-api/java/jvpp/gen/jvppgen/types_gen.py
@@ -142,17 +142,16 @@ def generate_type_setter(handler_name, type_def, c_name_prefix, object_name, ind
return indent + type_initialization.replace('\n', '\n' + indent)
-def generate_types(types_list, plugin_package, types_package, inputfile):
+def generate_types(types_list, plugin_package, types_package, inputfile, logger):
"""
Generates Java representation of custom types defined in api file.
"""
- #
if not types_list:
- print "Skipping custom types generation (%s does not define custom types)." % inputfile
+ logger.debug("Skipping custom types generation (%s does not define custom types)." % inputfile)
return
- print "Generating custom types"
+ logger.debug("Generating custom types for %s" % inputfile)
if not os.path.exists(types_package):
os.mkdir(types_package)