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

make sure glog only write to stderr using google::LogToStderr() #790

Merged
merged 1 commit into from Jan 4, 2024

Conversation

rocka
Copy link
Contributor

@rocka rocka commented Jan 3, 2024

Pull request

Feature

FLAGS_logtostderr works fine on desktop environments, but on Android, it does not write to logcat, and requires to have a valid log_dir in order to write log files as well as logcat.
https://github.com/google/glog/blob/b33e3bad4c46c8a6345525fd822af355e5ef9446/src/logging.cc#L809 (only LogDestination::MaybeLogToStderr can write to logcat on Android)
https://github.com/google/glog/blob/b33e3bad4c46c8a6345525fd822af355e5ef9446/src/logging.cc#L1840 (if FLAGS_logtostderr is set, the branch above cannot be reached)

google::LogToStderr() makes the log only goes to stderr on desktop, and logcat on Android.
https://github.com/google/glog/blob/b33e3bad4c46c8a6345525fd822af355e5ef9446/src/logging.cc#L727-L734

I only tested it on Android, maybe further testing is needed.

Unit test

  • Done

Manual test

  • Done

Code Review

  1. Unit and manual test pass
  2. GitHub Action CI pass
  3. At least one contributor reviews and votes
  4. Can be merged clean without conflicts
  5. PR will be merged by rebase upstream base

Additional Info

@lotem lotem merged commit 72f833d into rime:master Jan 4, 2024
8 checks passed
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 this pull request may close these issues.

None yet

2 participants