\r
#include "../version.h"\r
\r
-#include "exception\exceptions.h"\r
+#include "exception/exceptions.h"\r
+#include "log/log.h"\r
#include "utility/string.h"\r
\r
#include <boost/property_tree/ptree.hpp>\r
std::wcout << L" ### Invalid configuration file. ###";\r
throw;\r
}\r
+\r
+ try\r
+ {\r
+ auto media_path = boost::filesystem::wpath(media);\r
+ if(!boost::filesystem::exists(media_path))\r
+ boost::filesystem::create_directory(media_path);\r
+ \r
+ auto log_path = boost::filesystem::wpath(log);\r
+ if(!boost::filesystem::exists(log_path))\r
+ boost::filesystem::create_directory(log_path);\r
+ \r
+ auto template_path = boost::filesystem::wpath(ftemplate);\r
+ if(!boost::filesystem::exists(template_path))\r
+ boost::filesystem::create_directory(template_path);\r
+ \r
+ auto data_path = boost::filesystem::wpath(data);\r
+ if(!boost::filesystem::exists(data_path))\r
+ boost::filesystem::create_directory(data_path);\r
+ }\r
+ catch(...)\r
+ {\r
+ CASPAR_LOG_CURRENT_EXCEPTION();\r
+ CASPAR_LOG(error) << L"Failed to create configured directories.";\r
+ }\r
}\r
\r
const std::wstring& media_folder()\r
try\r
{\r
if(pCurrentCommand->Execute()) \r
- CASPAR_LOG(info) << "Executed command: " << pCurrentCommand->print();\r
+ CASPAR_LOG(trace) << "Executed command: " << pCurrentCommand->print();\r
else \r
- CASPAR_LOG(info) << "Failed to execute command: " << pCurrentCommand->print();\r
+ CASPAR_LOG(warning) << "Failed to execute command: " << pCurrentCommand->print();\r
}\r
catch(...)\r
{\r
CASPAR_LOG_CURRENT_EXCEPTION();\r
- CASPAR_LOG(info) << "Failed to execute command:" << pCurrentCommand->print();\r
+ CASPAR_LOG(error) << "Failed to execute command:" << pCurrentCommand->print();\r
}\r
\r
pCurrentCommand->SendReply();\r
\r
- CASPAR_LOG(info) << "Ready for a new command";\r
+ CASPAR_LOG(trace) << "Ready for a new command";\r
}\r
catch(...)\r
{\r
AMCPCommandPtr pCommand;\r
MessageParserState state = New;\r
\r
- CASPAR_LOG(info) << message;\r
+ CASPAR_LOG(info) << L"Received: " << message;\r
\r
std::size_t tokensInMessage = TokenizeMessage(message, &tokens);\r
\r
}\r
else {\r
if(sentBytes == bytesToSend) {\r
- if(sentBytes < 200)\r
- CASPAR_LOG(info) << "Sent " << socketInfo.sendQueue_.front().c_str() << TEXT(" to ") << socketInfo.host_.c_str();\r
+ if(sentBytes < 512)\r
+ CASPAR_LOG(info) << "Sent: " << socketInfo.sendQueue_.front().c_str() << TEXT(" to ") << socketInfo.host_.c_str();\r
else\r
- CASPAR_LOG(info) << "Sent more than 200 bytes to " << socketInfo.host_.c_str();\r
+ CASPAR_LOG(info) << "Sent more than 512 bytes to " << socketInfo.host_.c_str();\r
\r
socketInfo.currentlySending_.resize(0);\r
socketInfo.currentlySendingOffset_ = 0;\r