[
https://issues.apache.org/jira/browse/MESOS-7586?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andrei Budnik updated MESOS-7586:
---------------------------------
Description:
Some parts of mesos use glog before initialization of glog. This leads to
message like:
“WARNING: Logging before InitGoogleLogging() is written to STDERR”
Also, messages via glog before logging is initialized might not end up in a
logdir.
The solution might be:
{{cout/cerr}} should be used before logging initialization.
{{glog}} should be used after logging initialization.
Usually, main function has initialization pattern like:
# load = flags.load(argc, argv) // Load flags from command line.
# Check if flags are correct, otherwise print error message to cerr and then
exit.
# Check if user passed --help flag to print help message to cout and then exit.
# Parsing and setup of environment variables. If this fails, EXIT macro is used
to print error message via glog.
# process::initialize()
# logging::initialize()
Steps 2 and 3 should use {{cout/cerr}} to eliminate any extra information
generated by glog like current time, date and log level.
It would be preferable to move step 6 between steps 3 and 4 safely, because
{{logging::initialize()}} doesn’t depend on {{process::initialize()}}.
In addition, initialization of glog should be added, where it necessary.
was:
Some parts of mesos use glog before initialization of glog. This leads to
message like:
“WARNING: Logging before InitGoogleLogging() is written to STDERR”
Also, messages via glog before logging is initialized might not end up in a
logdir.
The solution might be:
cout/cerr should be used before logging initialization.
glog should be used after logging initialization.
Usually, main function has initialization pattern like:
# load = flags.load(argc, argv) // Load flags from command line.
# Check if flags are correct, otherwise print error message to cerr and then
exit.
# Check if user passed --help flag to print help message to cout and then exit.
# Parsing and setup of environment variables. If this fails, EXIT macro is used
to print error message via glog.
# process::initialize()
# logging::initialize()
Steps 2 and 3 should use cout/cerr to eliminate any extra information generated
by glog like current time, date and log level.
It would be preferable to move step 6 between steps 3 and 4 safely, because
{{logging::initialize()}} doesn’t depend on process::initialize().
Some parts of mesos don’t call logging::initialize(). This should also be fixed.
> Make use of cout/cerr and glog consistent.
> ------------------------------------------
>
> Key: MESOS-7586
> URL: https://issues.apache.org/jira/browse/MESOS-7586
> Project: Mesos
> Issue Type: Bug
> Reporter: Andrei Budnik
> Assignee: Armand Grillet
> Priority: Minor
> Labels: debugging, log, newbie
>
> Some parts of mesos use glog before initialization of glog. This leads to
> message like:
> “WARNING: Logging before InitGoogleLogging() is written to STDERR”
> Also, messages via glog before logging is initialized might not end up in a
> logdir.
>
> The solution might be:
> {{cout/cerr}} should be used before logging initialization.
> {{glog}} should be used after logging initialization.
>
> Usually, main function has initialization pattern like:
> # load = flags.load(argc, argv) // Load flags from command line.
> # Check if flags are correct, otherwise print error message to cerr and then
> exit.
> # Check if user passed --help flag to print help message to cout and then
> exit.
> # Parsing and setup of environment variables. If this fails, EXIT macro is
> used to print error message via glog.
> # process::initialize()
> # logging::initialize()
>
> Steps 2 and 3 should use {{cout/cerr}} to eliminate any extra information
> generated by glog like current time, date and log level.
> It would be preferable to move step 6 between steps 3 and 4 safely, because
> {{logging::initialize()}} doesn’t depend on {{process::initialize()}}.
> In addition, initialization of glog should be added, where it necessary.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)