]> git.sesse.net Git - casparcg/commitdiff
[env] Added backwards compatibility (with deprecation warning) for using thumbnails...
authorHelge Norberg <helge.norberg@svt.se>
Tue, 22 Nov 2016 14:08:20 +0000 (15:08 +0100)
committerHelge Norberg <helge.norberg@svt.se>
Tue, 22 Nov 2016 14:08:20 +0000 (15:08 +0100)
CHANGELOG
common/env.cpp
common/env.h
shell/main.cpp

index 3da21ca17422e756e7b758a969663b98b27f7071..6982a208c569da284faa406bce7e4f9fe9318808 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -8,6 +8,8 @@ General
 \r
   o Fail early with clear error message if configured paths are not\r
     creatable/writable.\r
+  o Added backwards compatibility (with deprecation warning) for using\r
+    thumbnails-path instead of thumbnail-path in casparcg.config.\r
 \r
 CasparCG 2.1.0 Beta 1 (w.r.t 2.0.7 Stable)\r
 ==========================================\r
index 6984e2d827104289839215795a7702ca5d91e9e3..b97daca058f2c184d0f208c2751c2f291ff9e556 100644 (file)
@@ -125,7 +125,7 @@ void configure(const std::wstring& filename)
                ftemplate       = clean_path(boost::filesystem::complete(paths.get(L"template-path", initial + L"/template/")).wstring());
                data            = clean_path(paths.get(L"data-path", initial + L"/data/"));
                font            = clean_path(paths.get(L"font-path", initial + L"/font/"));
-               thumbnails      = clean_path(paths.get(L"thumbnail-path", initial + L"/thumbnail/"));
+               thumbnails      = clean_path(paths.get(L"thumbnail-path", paths.get(L"thumbnails-path", initial + L"/thumbnail/")));
        }
        catch (...)
        {
@@ -208,4 +208,13 @@ const boost::property_tree::wptree& properties()
        return pt;
 }
 
+void log_configuration_warnings()
+{
+       if (pt.empty())
+               return;
+
+       if (pt.get_optional<std::wstring>(L"configuration.paths.thumbnails-path"))
+               CASPAR_LOG(warning) << L"Element thumbnails-path in casparcg.config has been deprecated. Use thumbnail-path instead.";
+}
+
 }}
index da4cde38d433907f57503410ed93761edb1f7bdf..d53776eec70f24e9797a954f28d3621456d47f93 100644 (file)
@@ -40,4 +40,6 @@ const std::wstring& version();
 
 const boost::property_tree::wptree& properties();
 
+void log_configuration_warnings();
+
 } }
index 6ae71f153c7980b6186f286f8a4f2bcbbfc7be29..76b465d06e522fa75b6add1dc92de7c990316e11 100644 (file)
@@ -324,6 +324,9 @@ int main(int argc, char** argv)
                log::add_file_sink(env::log_folder() + L"calltrace",    caspar::log::category == caspar::log::log_category::calltrace);
                std::wcout << L"Logging [info] or higher severity to " << env::log_folder() << std::endl << std::endl;
 
+               // Once logging to file, log configuration warnings.
+               env::log_configuration_warnings();
+
                // Setup console window.
                setup_console_window();
 
@@ -350,7 +353,7 @@ int main(int argc, char** argv)
        }
        catch (const user_error& e)
        {
-               CASPAR_LOG(fatal) << get_message_and_context(e) << " Please check the configuration file (" << u8(config_file_name) << ") for errors. Turn on log level debug for stacktrace.";
+               CASPAR_LOG(fatal) << get_message_and_context(e) << " Please check the configuration file (" << u8(config_file_name) << ") for errors.";
                wait_for_keypress();
        }
        catch(...)