Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup leveldb info log file from ENV LDB_INFO_LOG #1371

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion deps/leveldb-1.20/db/filename.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

#include <ctype.h>
#include <stdio.h>
#include <cstdlib>
#include "db/filename.h"
#include "db/dbformat.h"
#include "leveldb/env.h"
Expand Down Expand Up @@ -61,7 +62,13 @@ std::string TempFileName(const std::string& dbname, uint64_t number) {
}

std::string InfoLogFileName(const std::string& dbname) {
return dbname + "/LOG";
const char *ldb_log_file = std::getenv("LDB_INFO_LOG");
if (! ldb_log_file) {
return dbname + "/LOG";
} else {
std::string ret(ldb_log_file);
return ret;
}
}

// Return the name of the old info log file for "dbname".
Expand Down