Skip to content

Commit

Permalink
Merge pull request google#276 from drigz/add-example
Browse files Browse the repository at this point in the history
Add an example using glog from Bazel
  • Loading branch information
drigz committed Jan 4, 2018
2 parents 7019c32 + 4f1c958 commit c8b82a5
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 c8b82a5

Please sign in to comment.