[mxnet] Use __FILE__ instead of hard-coded path to generate log message
authorMuhwan Kim <mhkim4886@gmail.com>
Sun, 22 May 2022 19:40:53 +0000 (04:40 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Thu, 26 May 2022 13:41:54 +0000 (09:41 -0400)
__FILE__ macro is better, elegant way to print file names.

Signed-off-by: Muhwan Kim <mhkim4886@gmail.com>
ext/nnstreamer/tensor_filter/tensor_filter_mxnet.cc

index 20c3f62..144cf1d 100644 (file)
@@ -103,10 +103,6 @@ namespace nnstreamer
 {
 namespace tensorfilter_mxnet
 {
-
-const static std::string kFileLocation
-    = "<nnstreamer_repo_home>/ext/nnstreamer/tensor_filter/tensor_filter_mxnet.cc";
-
 extern "C" {
 void init_filter_mxnet (void)
     __attribute__ ((constructor)); /**< Dynamic library contstructor */
@@ -212,9 +208,8 @@ TensorFilterMXNet::configure_instance (const GstTensorFilterProperties *prop)
   try {
     parseCustomProperties (prop);
   } catch (const std::invalid_argument &e) {
-    throw std::invalid_argument (
-        "Failed to parse \"custom\" prop:" + std::string (e.what ())
-        + "\n\tReference: " + kFileLocation);
+    throw std::invalid_argument ("Failed to parse \"custom\" prop:"
+                                 + std::string (e.what ()) + "\n\tReference: " + __FILE__);
   }
 
   // Validate model file paths and then assign