Skip to content

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.

@sonarqubecloud
Copy link

@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