forked from facebook/rocksdb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix an import issue in fbcode. (facebook#10604)
Summary: This should fix an import issue detected in meta internal tests. Pull Request resolved: facebook#10604 Test Plan: Unit Tests. Reviewed By: hx235 Differential Revision: D39120414 Pulled By: gitbw95 fbshipit-source-id: dbd016d7f47b9f54aab5ea61e8d3cd79734f46af
- Loading branch information
1 parent
7c0838e
commit 6cd8133
Showing
5 changed files
with
39 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Copyright (c) Meta Platforms, Inc. and affiliates. | ||
// | ||
// This source code is licensed under both the GPLv2 (found in the | ||
// COPYING file in the root directory) and Apache 2.0 License | ||
// (found in the LICENSE.Apache file in the root directory). | ||
|
||
#include "util/stderr_logger.h" | ||
|
||
#include "port/sys_time.h" | ||
|
||
namespace ROCKSDB_NAMESPACE { | ||
StderrLogger::~StderrLogger() {} | ||
|
||
void StderrLogger::Logv(const char* format, va_list ap) { | ||
const uint64_t thread_id = Env::Default()->GetThreadID(); | ||
|
||
port::TimeVal now_tv; | ||
port::GetTimeOfDay(&now_tv, nullptr); | ||
const time_t seconds = now_tv.tv_sec; | ||
struct tm t; | ||
port::LocalTimeR(&seconds, &t); | ||
fprintf(stderr, "%04d/%02d/%02d-%02d:%02d:%02d.%06d %llx ", t.tm_year + 1900, | ||
t.tm_mon + 1, t.tm_mday, t.tm_hour, t.tm_min, t.tm_sec, | ||
static_cast<int>(now_tv.tv_usec), | ||
static_cast<long long unsigned int>(thread_id)); | ||
|
||
vfprintf(stderr, format, ap); | ||
fprintf(stderr, "\n"); | ||
} | ||
} // namespace ROCKSDB_NAMESPACE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters