Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No system link created along with the log files #599

Closed
zoukyle opened this issue Dec 17, 2020 · 0 comments · Fixed by #600
Closed

No system link created along with the log files #599

zoukyle opened this issue Dec 17, 2020 · 0 comments · Fixed by #600
Milestone

Comments

@zoukyle
Copy link

zoukyle commented Dec 17, 2020

How to reproduce:
Use the bazel environment:

################################################################################
# Define external binding for GFlags : https://github.com/gflags
# Use: //external:gflags
################################################################################
http_archive(
    name = "com_github_gflags_gflags",
    sha256 = "34af2f15cf7367513b352bdcd2493ab14ce43692d2dcd9dfc499492966c64dcf",
    strip_prefix = "gflags-2.2.2",
    urls = ["https://github.com/gflags/gflags/archive/v2.2.2.tar.gz"],
)

bind(
    name = "gflags",
    actual = "@com_github_gflags_gflags//:gflags",
)

################################################################################
# Define external binding for glog: https://github.com/google/glog
# Use: //external:glog
################################################################################
http_archive(
    name = "com_github_google_glog",
    sha256 = "62efeb57ff70db9ea2129a16d0f908941e355d09d6d83c9f7b18557c0a7ab59e",
    strip_prefix = "glog-d516278b1cd33cd148e8989aec488b6049a4ca0b",
    urls = ["https://github.com/google/glog/archive/d516278b1cd33cd148e8989aec488b6049a4ca0b.zip"],
)

bind(
    name = "glog",
    actual = "@com_github_google_glog//:glog",
)

The cc main file:
int main(int argc, char* argv[]) {
  google::InitGoogleLogging(argv[0]);
  google::InstallFailureSignalHandler();

  LOG(INFO) << "Initialized google logging";
  LOG(WARNING) << "This is a warning";
  LOG(ERROR) << "This is an error";

  CHECK(true);
  CHECK_GT(2, 1);
  CHECK_LE(1, 1);

  LogIfGt(2, 1);
  LogIfGt(1, 2);
  for (int i = 0; i < 200; ++i) {
    LOG_EVERY_N(INFO, 100) << "Log every 100, i is " << i;
  }

  return 0;
}

Run the example with: GLOG_log_dir=./tmp/ GLOG_alsologtostderr=1 bazel-bin/experimentals/examples/glog/example
The log dir has:
example.liang.liangzou.log.ERROR.20201217-090344.91782 example.liang.liangzou.log.INFO.20201217-090344.91782 example.liang.liangzou.log.WARNING.20201217-090344.91782
But there are no example.INFO etc system links created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants