Remove submodule glog
This commit is contained in:
parent
2096f93a92
commit
4021c565d2
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -1,9 +1,6 @@
|
|||
[submodule "test/gtest"]
|
||||
path = test/gtest
|
||||
url = https://github.com/google/googletest.git
|
||||
[submodule "third_party/glog"]
|
||||
path = third_party/glog
|
||||
url = https://github.com/google/glog.git
|
||||
[submodule "tools/linter"]
|
||||
path = tools/linter
|
||||
url = https://github.com/slightech/linter.git
|
||||
|
|
11
Makefile
11
Makefile
|
@ -24,7 +24,6 @@ help:
|
|||
@echo " make apidoc make api doc"
|
||||
@echo " make opendoc open api doc (html)"
|
||||
@echo " make init init project"
|
||||
@echo " make 3rdparty build 3rdparty: glog"
|
||||
@echo " make build build project"
|
||||
@echo " make install install project"
|
||||
@echo " make test build test and run"
|
||||
|
@ -61,15 +60,7 @@ opendoc: apidoc
|
|||
|
||||
submodules:
|
||||
@git submodule update --init
|
||||
|
||||
third_party: submodules
|
||||
@$(call echo,Make $@)
|
||||
@$(call echo,Make glog,33)
|
||||
@$(call cmake_build,./third_party/glog/_build)
|
||||
|
||||
3rdparty: third_party
|
||||
|
||||
.PHONY: submodules third_party 3rdparty
|
||||
.PHONY: submodules
|
||||
|
||||
# init
|
||||
|
||||
|
|
|
@ -17,4 +17,6 @@ option(WITH_API "Build with API layer, need OpenCV" ON)
|
|||
message(STATUS "Options:")
|
||||
message(STATUS " WITH_API: ${WITH_API}")
|
||||
|
||||
# How to install glog?
|
||||
# Ubuntu: `sudo apt-get install libgoogle-glog-dev`
|
||||
option(WITH_GLOG "Include glog support" OFF)
|
||||
|
|
|
@ -144,13 +144,10 @@ const int INFO = ::INFO;
|
|||
class MYNTEYE_API LogSink {
|
||||
public:
|
||||
virtual ~LogSink() {}
|
||||
virtual void send(LogSeverity severity,
|
||||
const char* full_filename,
|
||||
const char* base_filename,
|
||||
int line,
|
||||
const struct tm* tm_time,
|
||||
const char* message,
|
||||
size_t message_len) = 0;
|
||||
virtual void send(
|
||||
LogSeverity severity, const char *full_filename,
|
||||
const char *base_filename, int line, const struct tm *tm_time,
|
||||
const char *message, size_t message_len) = 0;
|
||||
virtual void WaitTillSent() = 0;
|
||||
};
|
||||
|
||||
|
@ -208,8 +205,8 @@ class MYNTEYE_API MessageLogger {
|
|||
|
||||
// Bound the logging level.
|
||||
const int kMaxVerboseLevel = 2;
|
||||
int android_level_index = std::min(std::max(FATAL, severity_),
|
||||
kMaxVerboseLevel) - FATAL;
|
||||
int android_level_index =
|
||||
std::min(std::max(FATAL, severity_), kMaxVerboseLevel) - FATAL;
|
||||
int android_log_level = android_log_levels[android_level_index];
|
||||
|
||||
// Output the log string the Android log at the appropriate level.
|
||||
|
@ -217,9 +214,7 @@ class MYNTEYE_API MessageLogger {
|
|||
|
||||
// Indicate termination if needed.
|
||||
if (severity_ == FATAL) {
|
||||
__android_log_write(ANDROID_LOG_FATAL,
|
||||
tag_.c_str(),
|
||||
"terminating.\n");
|
||||
__android_log_write(ANDROID_LOG_FATAL, tag_.c_str(), "terminating.\n");
|
||||
}
|
||||
#else
|
||||
// If not building on Android, log all output to std::cerr.
|
||||
|
@ -237,7 +232,9 @@ class MYNTEYE_API MessageLogger {
|
|||
}
|
||||
|
||||
// Return the stream associated with the logger object.
|
||||
std::stringstream &stream() { return stream_; }
|
||||
std::stringstream &stream() {
|
||||
return stream_;
|
||||
}
|
||||
|
||||
private:
|
||||
void LogToSinks(int severity) {
|
||||
|
@ -245,13 +242,14 @@ class MYNTEYE_API MessageLogger {
|
|||
struct tm *timeinfo;
|
||||
|
||||
time(&rawtime);
|
||||
timeinfo = localtime(&rawtime);
|
||||
timeinfo = localtime_r(&rawtime);
|
||||
std::set<google::LogSink *>::iterator iter;
|
||||
// Send the log message to all sinks.
|
||||
for (iter = google::log_sinks_global.begin();
|
||||
iter != google::log_sinks_global.end(); ++iter) {
|
||||
(*iter)->send(severity, file_.c_str(), filename_only_.c_str(), line_,
|
||||
timeinfo, stream_.str().c_str(), stream_.str().size());
|
||||
(*iter)->send(
|
||||
severity, file_.c_str(), filename_only_.c_str(), line_, timeinfo,
|
||||
stream_.str().c_str(), stream_.str().size());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -315,9 +313,11 @@ class MYNTEYE_API LoggerVoidify {
|
|||
|
||||
// Log only if condition is met. Otherwise evaluates to void.
|
||||
#define LOG_IF(severity, condition) \
|
||||
(static_cast<int>(severity) > google::log_severity_global || !(condition)) ? \
|
||||
(void) 0 : LoggerVoidify() & \
|
||||
MessageLogger((char *)__FILE__, __LINE__, "native", severity).stream()
|
||||
(static_cast<int>(severity) > google::log_severity_global || !(condition)) \
|
||||
? (void)0 \
|
||||
: LoggerVoidify() & \
|
||||
MessageLogger((char *)__FILE__, __LINE__, "native", severity) \
|
||||
.stream()
|
||||
|
||||
// Log only if condition is NOT met. Otherwise evaluates to void.
|
||||
#define LOG_IF_FALSE(severity, condition) LOG_IF(severity, !(condition))
|
||||
|
@ -370,11 +370,13 @@ class MYNTEYE_API LoggerVoidify {
|
|||
#ifndef NDEBUG
|
||||
#define DLOG LOG
|
||||
#else
|
||||
# define DLOG(severity) true ? (void) 0 : LoggerVoidify() & \
|
||||
MessageLogger((char *)__FILE__, __LINE__, "native", severity).stream()
|
||||
#define DLOG(severity) \
|
||||
true ? (void)0 \
|
||||
: LoggerVoidify() & \
|
||||
MessageLogger((char *)__FILE__, __LINE__, "native", severity) \
|
||||
.stream()
|
||||
#endif
|
||||
|
||||
|
||||
// Log a message and terminate.
|
||||
template <class T>
|
||||
void LogMessageFatal(const char *file, int line, const T &message) {
|
||||
|
@ -384,24 +386,26 @@ void LogMessageFatal(const char *file, int line, const T &message) {
|
|||
// ---------------------------- CHECK macros ---------------------------------
|
||||
|
||||
// Check for a given boolean condition.
|
||||
#define CHECK(condition) LOG_IF_FALSE(FATAL, condition) \
|
||||
<< "Check failed: " #condition " "
|
||||
#define CHECK(condition) \
|
||||
LOG_IF_FALSE(FATAL, condition) << "Check failed: " #condition " "
|
||||
|
||||
#ifndef NDEBUG
|
||||
// Debug only version of CHECK
|
||||
# define DCHECK(condition) LOG_IF_FALSE(FATAL, condition) \
|
||||
<< "Check failed: " #condition " "
|
||||
#define DCHECK(condition) \
|
||||
LOG_IF_FALSE(FATAL, condition) << "Check failed: " #condition " "
|
||||
#else
|
||||
// Optimized version - generates no code.
|
||||
# define DCHECK(condition) if (false) LOG_IF_FALSE(FATAL, condition) \
|
||||
<< "Check failed: " #condition " "
|
||||
#define DCHECK(condition) \
|
||||
if (false) \
|
||||
LOG_IF_FALSE(FATAL, condition) << "Check failed: " #condition " "
|
||||
#endif // NDEBUG
|
||||
|
||||
// ------------------------- CHECK_OP macros ---------------------------------
|
||||
|
||||
// Generic binary operator check macro. This should not be directly invoked,
|
||||
// instead use the binary comparison macros defined below.
|
||||
#define CHECK_OP(val1, val2, op) LOG_IF_FALSE(FATAL, (val1 op val2)) \
|
||||
#define CHECK_OP(val1, val2, op) \
|
||||
LOG_IF_FALSE(FATAL, (val1 op val2)) \
|
||||
<< "Check failed: " #val1 " " #op " " #val2 " "
|
||||
|
||||
// Check_op macro definitions
|
||||
|
@ -422,12 +426,24 @@ void LogMessageFatal(const char *file, int line, const T &message) {
|
|||
#define DCHECK_GT(val1, val2) CHECK_OP(val1, val2, >)
|
||||
#else
|
||||
// These versions generate no code in optimized mode.
|
||||
# define DCHECK_EQ(val1, val2) if (false) CHECK_OP(val1, val2, ==)
|
||||
# define DCHECK_NE(val1, val2) if (false) CHECK_OP(val1, val2, !=)
|
||||
# define DCHECK_LE(val1, val2) if (false) CHECK_OP(val1, val2, <=)
|
||||
# define DCHECK_LT(val1, val2) if (false) CHECK_OP(val1, val2, <)
|
||||
# define DCHECK_GE(val1, val2) if (false) CHECK_OP(val1, val2, >=)
|
||||
# define DCHECK_GT(val1, val2) if (false) CHECK_OP(val1, val2, >)
|
||||
#define DCHECK_EQ(val1, val2) \
|
||||
if (false) \
|
||||
CHECK_OP(val1, val2, ==)
|
||||
#define DCHECK_NE(val1, val2) \
|
||||
if (false) \
|
||||
CHECK_OP(val1, val2, !=)
|
||||
#define DCHECK_LE(val1, val2) \
|
||||
if (false) \
|
||||
CHECK_OP(val1, val2, <=)
|
||||
#define DCHECK_LT(val1, val2) \
|
||||
if (false) \
|
||||
CHECK_OP(val1, val2, <)
|
||||
#define DCHECK_GE(val1, val2) \
|
||||
if (false) \
|
||||
CHECK_OP(val1, val2, >=)
|
||||
#define DCHECK_GT(val1, val2) \
|
||||
if (false) \
|
||||
CHECK_OP(val1, val2, >)
|
||||
#endif // NDEBUG
|
||||
|
||||
// ---------------------------CHECK_NOTNULL macros ---------------------------
|
||||
|
@ -462,7 +478,8 @@ T& CheckNotNull(const char *file, int line, const char *names, T& t) {
|
|||
CheckNotNull(__FILE__, __LINE__, "'" #val "' Must be non NULL", (val))
|
||||
#else
|
||||
// Optimized version - generates no code.
|
||||
#define DCHECK_NOTNULL(val) if (false)\
|
||||
#define DCHECK_NOTNULL(val) \
|
||||
if (false) \
|
||||
CheckNotNull(__FILE__, __LINE__, "'" #val "' Must be non NULL", (val))
|
||||
#endif // NDEBUG
|
||||
|
||||
|
|
|
@ -13,8 +13,8 @@
|
|||
// limitations under the License.
|
||||
#include <opencv2/highgui/highgui.hpp>
|
||||
|
||||
#include "mynteye/logger.h"
|
||||
#include "mynteye/api.h"
|
||||
#include "mynteye/logger.h"
|
||||
#include "mynteye/times.h"
|
||||
|
||||
MYNTEYE_USE_NAMESPACE
|
||||
|
|
|
@ -90,7 +90,9 @@ bool dir_exists(const std::string &p) {
|
|||
|
||||
std::vector<std::string> get_plugin_paths() {
|
||||
std::string info_path(MYNTEYE_SDK_INSTALL_DIR);
|
||||
info_path.append(MYNTEYE_OS_SEP "share" MYNTEYE_OS_SEP "mynteye" MYNTEYE_OS_SEP "build.info");
|
||||
info_path.append(
|
||||
MYNTEYE_OS_SEP "share" MYNTEYE_OS_SEP "mynteye" MYNTEYE_OS_SEP
|
||||
"build.info");
|
||||
|
||||
cv::FileStorage fs(info_path, cv::FileStorage::READ);
|
||||
if (!fs.isOpened()) {
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
#include <gflags/gflags.h>
|
||||
#endif
|
||||
|
||||
#include "mynteye/mynteye.h"
|
||||
#include "mynteye/logger.h"
|
||||
#include "mynteye/mynteye.h"
|
||||
|
||||
int main(int /*argc*/, char *argv[]) {
|
||||
// Set whether log messages go to stderr instead of logfiles
|
||||
|
|
1
third_party/glog
vendored
1
third_party/glog
vendored
|
@ -1 +0,0 @@
|
|||
Subproject commit 8d7a107d68c127f3f494bb7807b796c8c5a97a82
|
|
@ -20,8 +20,8 @@
|
|||
|
||||
#include "mynteye/device.h"
|
||||
#include "mynteye/files.h"
|
||||
#include "mynteye/types.h"
|
||||
#include "mynteye/logger.h"
|
||||
#include "mynteye/types.h"
|
||||
|
||||
#include "internal/types.h"
|
||||
|
||||
|
@ -231,7 +231,8 @@ void DeviceWriter::SaveAllInfos(const std::string &dir) {
|
|||
}
|
||||
SaveDeviceInfo(*device_->GetInfo(), dir + MYNTEYE_OS_SEP "device.info");
|
||||
SaveImgParams(
|
||||
*device_->GetInfo(), device_->GetImgParams(), dir + MYNTEYE_OS_SEP "img.params");
|
||||
*device_->GetInfo(), device_->GetImgParams(),
|
||||
dir + MYNTEYE_OS_SEP "img.params");
|
||||
auto &&m_in = device_->GetMotionIntrinsics();
|
||||
SaveImuParams(
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user