]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
debug: only truncate log file on open if log_per_instance is set
authorSage Weil <sage@newdream.net>
Fri, 9 Jul 2010 17:45:49 +0000 (10:45 -0700)
committerSage Weil <sage@newdream.net>
Fri, 9 Jul 2010 18:27:34 +0000 (11:27 -0700)
Signed-off-by: Sage Weil <sage@newdream.net>
src/common/debug.cc

index 12b9b2d1276bf39f99c80791b0f181ab13fee4cb..49d58f08e0b6d7b3b45056a870d6e2439699f45f 100644 (file)
@@ -154,7 +154,8 @@ void _dout_open_log()
   }
 
   _dout_out.close();
-  _dout_out.open(_dout_path, ios::trunc|ios::out);
+  // only truncate if log_per_instance is set.
+  _dout_out.open(_dout_path, g_conf.log_per_instance ? (ios::trunc|ios::out) : ios::out);
   if (!_dout_out.is_open()) {
     std::cerr << "error opening output file " << _dout_path << std::endl;
     _dout = &std::cout;