Add DEBUG_TRACE output to file utility functions in libpbd
authorPaul Davis <paul@linuxaudiosystems.com>
Sat, 13 Jul 2013 20:55:40 +0000 (16:55 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Sat, 13 Jul 2013 20:55:40 +0000 (16:55 -0400)
libs/pbd/debug.cc
libs/pbd/file_utils.cc
libs/pbd/pbd/debug.h

index 51d4d1e8714f0f6dddc43caa9d01f50c6a3e0dec..fba457c83eeb256012b2b2f36dfae97a406c8861 100644 (file)
@@ -49,6 +49,7 @@ uint64_t PBD::DEBUG::FileManager = PBD::new_debug_bit ("filemanager");
 uint64_t PBD::DEBUG::Pool = PBD::new_debug_bit ("pool");
 uint64_t PBD::DEBUG::EventLoop = PBD::new_debug_bit ("eventloop");
 uint64_t PBD::DEBUG::AbstractUI = PBD::new_debug_bit ("abstractui");
 uint64_t PBD::DEBUG::Pool = PBD::new_debug_bit ("pool");
 uint64_t PBD::DEBUG::EventLoop = PBD::new_debug_bit ("eventloop");
 uint64_t PBD::DEBUG::AbstractUI = PBD::new_debug_bit ("abstractui");
+uint64_t PBD::DEBUG::FileUtils = PBD::new_debug_bit ("fileutils");
 
 uint64_t PBD::debug_bits = 0x0;
 
 
 uint64_t PBD::debug_bits = 0x0;
 
index 01c2fe286a406f1752687abc3ce282ab846ad941..1a32377ff681219a8ded2af273fee0d8dda35119 100644 (file)
@@ -35,6 +35,7 @@
 
 #include "pbd/compose.h"
 #include "pbd/file_utils.h"
 
 #include "pbd/compose.h"
 #include "pbd/file_utils.h"
+#include "pbd/debug.h"
 #include "pbd/error.h"
 #include "pbd/pathscanner.h"
 #include "pbd/stl_delete.h"
 #include "pbd/error.h"
 #include "pbd/pathscanner.h"
 #include "pbd/stl_delete.h"
@@ -80,6 +81,11 @@ find_matching_files_in_directory (const std::string& directory,
                std::string full_path(directory);
                full_path = Glib::build_filename (full_path, *file_iter);
 
                std::string full_path(directory);
                full_path = Glib::build_filename (full_path, *file_iter);
 
+               DEBUG_TRACE (
+                       DEBUG::FileUtils,
+                       string_compose("Found file %1\n", full_path)
+                       );
+
                result.push_back(full_path);
        }
 }
                result.push_back(full_path);
        }
 }
@@ -117,24 +123,28 @@ find_file_in_search_path(const SearchPath& search_path,
 
        if (tmp.size() == 0)
        {
 
        if (tmp.size() == 0)
        {
+               DEBUG_TRACE (
+                       DEBUG::FileUtils,
+                       string_compose("No file matching %1 found in Path: %2\n", filename, search_path.to_string())
+                           );
                return false;
        }
 
                return false;
        }
 
-#if 0
        if (tmp.size() != 1)
        {
        if (tmp.size() != 1)
        {
-               info << string_compose
-                       (
-                        "Found more than one file matching %1 in search path %2",
-                        filename,
-                        search_path ()
-                       )
-                       << endmsg;
+               DEBUG_TRACE (
+                       DEBUG::FileUtils,
+                       string_compose("Found more that one file matching %1 in Path: %2\n", filename, search_path.to_string())
+                           );
        }
        }
-#endif
 
        result = tmp.front();
 
 
        result = tmp.front();
 
+       DEBUG_TRACE (
+               DEBUG::FileUtils,
+               string_compose("Found file %1 in Path: %2\n", filename, search_path.to_string())
+                   );
+
        return true;
 }
 
        return true;
 }
 
index 989cd42dd1f59d82986a21f54856dc89a64b5de6..704c9d0dadd2c680f26a30faa7f13110b0b5e0c9 100644 (file)
@@ -43,6 +43,7 @@ namespace PBD {
                extern uint64_t Pool;
                extern uint64_t EventLoop;
                extern uint64_t AbstractUI;
                extern uint64_t Pool;
                extern uint64_t EventLoop;
                extern uint64_t AbstractUI;
+               extern uint64_t FileUtils;
        }
 }
 
        }
 }