diff options
author | Vincent Ambo <tazjin@google.com> | 2020-05-27T00·26+0100 |
---|---|---|
committer | Vincent Ambo <tazjin@google.com> | 2020-05-27T00·26+0100 |
commit | afe04691aca3f669f517adaeb5bd4a87a481fb4a (patch) | |
tree | 60ae6c91a3959b2f6486256e26ff126e598d1e5d /bazel/example/main.cc |
Squashed 'third_party/glog/' content from commit 9ef754a3023
git-subtree-dir: third_party/glog git-subtree-split: 9ef754a3023e6fd10f20fe53dfca96dd898182e3
Diffstat (limited to 'bazel/example/main.cc')
-rw-r--r-- | bazel/example/main.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/bazel/example/main.cc b/bazel/example/main.cc new file mode 100644 index 000000000000..fef01dc15752 --- /dev/null +++ b/bazel/example/main.cc @@ -0,0 +1,22 @@ +#include <gflags/gflags.h> +#include <glog/logging.h> +#include <glog/stl_logging.h> + +int main(int argc, char* argv[]) { + // Initialize Google's logging library. + google::InitGoogleLogging(argv[0]); + + // Optional: parse command line flags + gflags::ParseCommandLineFlags(&argc, &argv, true); + + LOG(INFO) << "Hello, world!"; + + // glog/stl_logging.h allows logging STL containers. + std::vector<int> x; + x.push_back(1); + x.push_back(2); + x.push_back(3); + LOG(INFO) << "ABC, it's easy as " << x; + + return 0; +} |