From 4ce2beaa6d1cab7ed8063bbe1472e13a4280ebc0 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sun, 15 Jul 2012 22:27:11 +0300 Subject: [PATCH] More reporting about reading and writing files and traversing directories --- source/component.cpp | 1 + source/config.cpp | 2 ++ source/dependencycache.cpp | 9 ++++++--- source/packagemanager.cpp | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/source/component.cpp b/source/component.cpp index 9262af3..93d450b 100644 --- a/source/component.cpp +++ b/source/component.cpp @@ -223,6 +223,7 @@ PathList Component::collect_source_files() const FS::Path path(*i); if(FS::is_dir(path)) { + pkg.get_builder().get_logger().log("files", format("Traversing %s", path)); list sfiles = list_files(path); for(list::iterator j=sfiles.begin(); j!=sfiles.end(); ++j) files.push_back(path / *j); diff --git a/source/config.cpp b/source/config.cpp index 194bf0d..5b43fe3 100644 --- a/source/config.cpp +++ b/source/config.cpp @@ -62,6 +62,7 @@ void Config::save() const FS::Path fn = package.get_source()/".config"; + package.get_builder().get_logger().log("files", format("Writing %s", fn)); IO::BufferedFile out(fn.str(), IO::M_WRITE); for(OptionMap::const_iterator i=options.begin(); i!=options.end(); ++i) @@ -90,6 +91,7 @@ void Config::load() FS::Stat stat = FS::stat(fn); if(stat) { + package.get_builder().get_logger().log("files", format("Reading %s", fn)); IO::BufferedFile in(fn.str()); mtime = stat.get_modify_time(); diff --git a/source/dependencycache.cpp b/source/dependencycache.cpp index 15abf08..e91bdbc 100644 --- a/source/dependencycache.cpp +++ b/source/dependencycache.cpp @@ -36,7 +36,9 @@ void DependencyCache::save() const if(deps.empty() || !changed) return; - IO::BufferedFile out((package.get_source()/".deps").str(), IO::M_WRITE); + FS::Path fn = package.get_source()/".deps"; + package.get_builder().get_logger().log("files", format("Writing %s", fn)); + IO::BufferedFile out(fn.str(), IO::M_WRITE); for(DepsMap::const_iterator i=deps.begin(); i!=deps.end(); ++i) { @@ -49,11 +51,12 @@ void DependencyCache::save() const void DependencyCache::load() { - string fn = (package.get_source()/".deps").str(); + FS::Path fn = package.get_source()/".deps"; if(FS::Stat st = FS::stat(fn)) { - IO::BufferedFile in(fn); + package.get_builder().get_logger().log("files", format("Reading %s", fn)); + IO::BufferedFile in(fn.str()); string line; while(in.getline(line)) diff --git a/source/packagemanager.cpp b/source/packagemanager.cpp index 5cc768a..01c9e09 100644 --- a/source/packagemanager.cpp +++ b/source/packagemanager.cpp @@ -123,6 +123,7 @@ FS::Path PackageManager::get_package_location(const string &name) { for(list::const_iterator i=pkg_path.begin(); i!=pkg_path.end(); ++i) { + builder.get_logger().log("files", format("Traversing %s", *i)); list files = list_files(*i); for(list::const_iterator j=files.begin(); j!=files.end(); ++j) { -- 2.45.2