Austin Schuh | 906616c | 2019-01-21 20:25:11 -0800 | [diff] [blame^] | 1 | #include <gflags/gflags.h> |
| 2 | #include <glog/logging.h> |
| 3 | #include <glog/stl_logging.h> |
| 4 | |
| 5 | int main(int argc, char* argv[]) { |
| 6 | // Initialize Google's logging library. |
| 7 | google::InitGoogleLogging(argv[0]); |
| 8 | |
| 9 | // Optional: parse command line flags |
| 10 | gflags::ParseCommandLineFlags(&argc, &argv, true); |
| 11 | |
| 12 | LOG(INFO) << "Hello, world!"; |
| 13 | |
| 14 | // glog/stl_logging.h allows logging STL containers. |
| 15 | std::vector<int> x; |
| 16 | x.push_back(1); |
| 17 | x.push_back(2); |
| 18 | x.push_back(3); |
| 19 | LOG(INFO) << "ABC, it's easy as " << x; |
| 20 | |
| 21 | return 0; |
| 22 | } |