Skip to content

Instantly share code, notes, and snippets.

@xingfeT
Last active September 27, 2021 06:23
Show Gist options
  • Save xingfeT/71f1b2bcd072c8a2ad7c2a95775e1716 to your computer and use it in GitHub Desktop.
Save xingfeT/71f1b2bcd072c8a2ad7c2a95775e1716 to your computer and use it in GitHub Desktop.
using glogs
set(WITH_GFLAGS OFF)
FetchContent_Declare(
glog
URL ${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/glog-master.zip
)
FetchContent_MakeAvailable(glog)
add_executable(glog-test GLogTest.cpp)
target_link_libraries (glog-test glog::glog)
@xingfeT
Copy link
Author

xingfeT commented Sep 27, 2021

#include <glog/logging.h>

int main(int argc, char* argv[]) {
// Initialize Google’s logging library.
google::InitGoogleLogging(argv[0]);

// ...
LOG(INFO) << "Found " << "xxx" << " cookies";
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment