Skip to content

Commit

Permalink
Add an example using glog from Bazel
Browse files Browse the repository at this point in the history
  • Loading branch information
drigz committed Jan 4, 2018
1 parent bffb4a6 commit 3efe9e4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bazel/example/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cc_test(
name = "main",
size = "small",
srcs = ["main.cc"],
deps = [
"//:glog",
],
)
14 changes: 14 additions & 0 deletions bazel/example/main.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <gflags/gflags.h>
#include <glog/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!";

return 0;
}

0 comments on commit 3efe9e4

Please sign in to comment.