Permalink
Browse files

Write value of executing options to log upon database open.

  • Loading branch information...
1 parent 9502d92 commit 17875bb891ddf8690ec1d9be8b9269dfafcbff86 @matthewvon matthewvon committed May 18, 2012
Showing with 23 additions and 0 deletions.
  1. +2 −0 db/db_impl.cc
  2. +2 −0 include/leveldb/options.h
  3. +19 −0 util/options.cc
View
@@ -140,6 +140,8 @@ DBImpl::DBImpl(const Options& options, const std::string& dbname)
versions_ = new VersionSet(dbname_, &options_, table_cache_,
&internal_comparator_);
+
+ options_.Dump(options_.info_log);
}
DBImpl::~DBImpl() {
@@ -137,6 +137,8 @@ struct Options {
// Create an Options object with default values for all fields.
Options();
+
+ void Dump(Logger * log) const;
};
// Options that control read operations
View
@@ -26,4 +26,23 @@ Options::Options()
}
+void
+Options::Dump(
+ Logger * log) const
+{
+ Log(log," Options.comparator: %p", comparator);
+ Log(log," Options.create_if_missing: %d", create_if_missing);
+ Log(log," Options.error_if_exists: %d", error_if_exists);
+ Log(log," Options.paranoid_checks: %d", paranoid_checks);
+ Log(log," Options.env: %p", env);
+ Log(log," Options.info_log: %p", info_log);
+ Log(log," Options.write_buffer_size: %zd", write_buffer_size);
+ Log(log," Options.max_open_files: %d", max_open_files);
+ Log(log," Options.block_cache: %p", block_cache);
+ Log(log," Options.block_size: %d", block_size);
+ Log(log,"Options.block_restart_interval: %d", block_restart_interval);
+ Log(log," Options.filter_policy: %p", filter_policy);
+
+} // Options::Dump
+
} // namespace leveldb

0 comments on commit 17875bb

Please sign in to comment.