Fix missing grok log setup in dcpomatic_cli.
[dcpomatic.git] / src / tools / dcpomatic_cli.cc
index 40461b7949d338300a07dee27ac9a5b0f9b5f90a..19f28f5ced71ac9ff8810ca2e2534ff49ca16d56 100644 (file)
@@ -28,6 +28,9 @@
 #include "lib/ffmpeg_encoder.h"
 #include "lib/film.h"
 #include "lib/filter.h"
+#ifdef DCPOMATIC_GROK
+#include "lib/grok/context.h"
+#endif
 #include "lib/hints.h"
 #include "lib/job_manager.h"
 #include "lib/json_server.h"
@@ -39,6 +42,7 @@
 #include "lib/util.h"
 #include "lib/version.h"
 #include "lib/video_content.h"
+#include <dcp/filesystem.h>
 #include <dcp/version.h>
 #include <getopt.h>
 #include <iostream>
@@ -412,7 +416,7 @@ main (int argc, char* argv[])
        signal_manager = new SignalManager ();
 
        if (no_remote || export_format) {
-               EncodeServerFinder::instance()->stop ();
+               EncodeServerFinder::drop();
        }
 
        if (json_port) {
@@ -442,7 +446,7 @@ main (int argc, char* argv[])
        for (auto i: film->content()) {
                auto paths = i->paths();
                for (auto j: paths) {
-                       if (!boost::filesystem::exists(j)) {
+                       if (!dcp::filesystem::exists(j)) {
                                cerr << argv[0] << ": content file " << j << " not found.\n";
                                exit (EXIT_FAILURE);
                        }
@@ -484,17 +488,21 @@ main (int argc, char* argv[])
                std::cout << UP_ONE_LINE_AND_ERASE;
 
                if (!hints.empty()) {
-                       std::cout << "Hints:\n\n";
+                       std::cerr << "Hints:\n\n";
                        for (auto hint: hints) {
-                               std::cout << word_wrap("* " + hint, 70) << "\n";
+                               std::cerr << word_wrap("* " + hint, 70) << "\n";
                        }
-                       std::cout << "*** Encoding aborted because hints were found ***\n\n";
-                       std::cout << "Modify your settings and run the command again, or run without\n";
-                       std::cout << "the `--hints' option to ignore these hints and encode anyway.\n";
+                       std::cerr << "*** Encoding aborted because hints were found ***\n\n";
+                       std::cerr << "Modify your settings and run the command again, or run without\n";
+                       std::cerr << "the `--hints' option to ignore these hints and encode anyway.\n";
                        exit(EXIT_FAILURE);
                }
        }
 
+#ifdef DCPOMATIC_GROK
+                       grk_plugin::setMessengerLogger(new grk_plugin::GrokLogger("[GROK] "));
+#endif
+
        if (progress) {
                if (export_format) {
                        cout << "\nExporting " << film->name() << "\n";