Closes [t:2670]. Direct error output to error log, not stderr, when verbose=0.

git-svn-id: file:///svn/toku/tokudb@20847 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
Barry Perlman 2013-04-16 23:59:17 -04:00 committed by Yoni Fogel
parent e5ce7dfb2a
commit fa0666f746

View file

@ -48,8 +48,14 @@ setup (void) {
CKERR(r);
r=toku_os_mkdir(ENVDIR, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
FILE *error_file = 0;
if (verbose==0) {
error_file = fopen(ENVDIR "/stderr", "w"); assert(error_file);
}
else error_file = stderr;
r=db_env_create(&env, 0); CKERR(r);
env->set_errfile(env, stderr);
env->set_errfile(env, error_file ? error_file : stderr);
r=env->open(env, ENVDIR, DB_INIT_LOCK|DB_INIT_LOG|DB_INIT_MPOOL|DB_INIT_TXN|DB_CREATE|DB_PRIVATE, S_IRWXU+S_IRWXG+S_IRWXO); CKERR(r);
}
@ -397,12 +403,21 @@ int
test_main (int argc, char *const argv[]) {
parse_args(argc, argv);
setup();
print_engine_status(env);
if (verbose >= 2) {
printf("Immediately after setup:\n");
print_engine_status(env);
}
test_fileops_1();
print_engine_status(env);
if (verbose >= 2) {
printf("After test_1:\n");
print_engine_status(env);
}
test_fileops_2();
test_fileops_3();
print_engine_status(env);
if (verbose >= 2) {
printf("After test_2 and test_3:\n");
print_engine_status(env);
}
test_shutdown();
return 0;
}