Skip to content

Commit

Permalink
remove unused WindowsLogger
Browse files Browse the repository at this point in the history
  • Loading branch information
dwing4g committed Mar 5, 2019
1 parent ac2d2d8 commit 4c93c28
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
19 changes: 0 additions & 19 deletions util/env_windows.cc
Original file line number Diff line number Diff line change
Expand Up @@ -153,25 +153,6 @@ class WindowsFileLock : public FileLock {
}
};

class WindowsLogger : public Logger {
WritableFile* log_;

public:
WindowsLogger(WritableFile* log) : log_(log) {}
virtual ~WindowsLogger() { delete log_; }

// Write an entry to the log file with the specified format.
virtual void Logv(const char* format, va_list ap) {
const size_t kBufSize = 4096;
char buffer[kBufSize];
int written = vsnprintf(buffer, kBufSize - 1, format, ap);
if(written < 0) written = kBufSize - 1;
buffer[written++] = '\n';
log_->Append(Slice(buffer, written));
log_->Flush();
}
};

}

class WindowsEnv : public Env {
Expand Down
2 changes: 2 additions & 0 deletions util/jni.cc
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ extern "C" JNIEXPORT jint JNICALL DEF_JAVA(leveldb_1write)
mid_getKey = jenv->GetMethodID(cls_entry, "getKey", "()Ljava/lang/Object;");
mid_getValue = jenv->GetMethodID(cls_entry, "getValue", "()Ljava/lang/Object;");
fid_buffer = jenv->GetFieldID(cls_octets, "_buffer", "[B");
if(!fid_buffer) fid_buffer = jenv->GetFieldID(cls_octets, "buffer", "[B");
fid_count = jenv->GetFieldID(cls_octets, "_count", "I");
if(!fid_count) fid_count = jenv->GetFieldID(cls_octets, "count", "I");
if(!mid_hasNext || !mid_next || !mid_getKey || !mid_getValue || !fid_buffer || !fid_count) return s_err = 3;
s_err = 0;
}
Expand Down

0 comments on commit 4c93c28

Please sign in to comment.