Set log levels after commandline options are parsed. Fixes --verbose, --quiet and --log-levels
This commit is contained in:
parent
eec246718a
commit
0b97a29aa1
|
@ -286,14 +286,14 @@ int main(int argc, char* argv[]) {
|
||||||
|
|
||||||
RegisterMetaTypes();
|
RegisterMetaTypes();
|
||||||
|
|
||||||
CommandlineOptions options(argc, argv);
|
// Initialise logging. Log levels are set after the commandline options are
|
||||||
|
// parsed below.
|
||||||
// Initialise logging
|
|
||||||
logging::Init();
|
logging::Init();
|
||||||
logging::SetLevels(options.log_levels());
|
|
||||||
g_log_set_default_handler(reinterpret_cast<GLogFunc>(&logging::GLog),
|
g_log_set_default_handler(reinterpret_cast<GLogFunc>(&logging::GLog),
|
||||||
nullptr);
|
nullptr);
|
||||||
|
|
||||||
|
CommandlineOptions options(argc, argv);
|
||||||
|
|
||||||
{
|
{
|
||||||
// Only start a core application now so we can check if there's another
|
// Only start a core application now so we can check if there's another
|
||||||
// Clementine running without needing an X server.
|
// Clementine running without needing an X server.
|
||||||
|
@ -306,6 +306,7 @@ int main(int argc, char* argv[]) {
|
||||||
// Parse commandline options - need to do this before starting the
|
// Parse commandline options - need to do this before starting the
|
||||||
// full QApplication so it works without an X server
|
// full QApplication so it works without an X server
|
||||||
if (!options.Parse()) return 1;
|
if (!options.Parse()) return 1;
|
||||||
|
logging::SetLevels(options.log_levels());
|
||||||
|
|
||||||
if (a.isRunning()) {
|
if (a.isRunning()) {
|
||||||
if (options.is_empty()) {
|
if (options.is_empty()) {
|
||||||
|
|
Loading…
Reference in New Issue