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

refactor: initialize google logger after parsing options #2664

Merged
merged 5 commits into from
Nov 16, 2024

Conversation

aleksraiden
Copy link
Contributor

At startup we need to init a logger after fully initialising config and parsing command line override options. I think this way is clearer and in some cases Google Logger can't apply options from flag after calling google::InitGoogleLogging.

@mapleFU
Copy link
Member

mapleFU commented Nov 15, 2024

and in some cases Google Logger can't apply options from flag after calling google::InitGoogleLogging.

Just curious is there any doc for this behavior?

@aleksraiden
Copy link
Contributor Author

and in some cases Google Logger can't apply options from flag after calling google::InitGoogleLogging.

Just curious is there any doc for this behavior?

I'm not a familiar with c+/glog, but I interpret this moment from docs (https://google.github.io/glog/0.8.0/flags/#using-command-line-parameters-and-environment-variables):

You can also modify flag values in your program by modifying global variables FLAGS_*. Most settings start working immediately after you update FLAGS_*. The exceptions are the flags related to destination files. For instance, you might want to set FLAGS_log_dir before calling google::InitGoogleLogging.

Copy link

sonarcloud bot commented Nov 15, 2024

@git-hulk git-hulk merged commit 185bfc6 into unstable Nov 16, 2024
62 checks passed
@aleksraiden aleksraiden deleted the aleksraiden-gloginit-reorder branch November 16, 2024 08:17
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.

5 participants