main: fix loggingEnabled checking

loggingPath is not populated after args are parsed.
Tested: with -l, swampd correctly generated logs

Resolves: openbmc/phosphor-pid-control#12
Signed-off-by: Kun Yi <kunyi731@gmail.com>
Change-Id: Ic103879f6b65d4e89c49e8d9700c5d71b9549f4d
diff --git a/main.cpp b/main.cpp
index db355ab..be0691d 100644
--- a/main.cpp
+++ b/main.cpp
@@ -139,10 +139,10 @@
         ->check(CLI::ExistingDirectory);
     app.add_flag("-t,--tuning", tuningEnabled, "Enable or disable tuning");
 
-    loggingEnabled = (!loggingPath.empty());
-
     CLI11_PARSE(app, argc, argv);
 
+    loggingEnabled = (!loggingPath.empty());
+
     static constexpr auto modeRoot = "/xyz/openbmc_project/settings/fanctrl";
     // Create a manager for the ModeBus because we own it.
     sdbusplus::server::manager::manager(