CASPAR_THROW_EXCEPTION(caspar_exception() << msg_info("Failed to allocate buffer."));
if(timer.elapsed() > 0.02)
- CASPAR_LOG(debug) << L"[buffer] Performance warning. Buffer allocation blocked: " << timer.elapsed();
+ CASPAR_LOG(warning) << L"[buffer] Performance warning. Buffer allocation blocked: " << timer.elapsed();
//CASPAR_LOG(trace) << "[buffer] [" << ++(usage_ == buffer::usage::write_only ? g_w_total_count : g_r_total_count) << L"] allocated size:" << size_ << " usage: " << (usage == buffer::usage::write_only ? "write_only" : "read_only");
}
data_ = (uint8_t*) result;
if(timer.elapsed() > 0.02)
- CASPAR_LOG(debug) << L"[buffer] Performance warning. Buffer mapping blocked: " << timer.elapsed();
+ CASPAR_LOG(warning) << L"[buffer] Performance warning. Buffer mapping blocked: " << timer.elapsed();
GL(glBindBuffer(target_, 0));
if(!data_)
}, task_priority::high_priority);
if(timer.elapsed() > 0.02)
- CASPAR_LOG(debug) << L"[ogl-device] Performance warning. Buffer allocation blocked: " << timer.elapsed();
+ CASPAR_LOG(warning) << L"[ogl-device] Performance warning. Buffer allocation blocked: " << timer.elapsed();
}
std::weak_ptr<impl> self = shared_from_this(); // buffers can leave the device context, take a hold on life-time.
~executor()
{
- CASPAR_LOG(trace) << L"Shutting down " << name_;
+ CASPAR_LOG(debug) << L"Shutting down " << name_;
try
{
if (!execution_queue_.try_push(priority, function))
{
- CASPAR_LOG(debug) << print() << L" Overflow. Blocking caller.";
+ CASPAR_LOG(warning) << print() << L" Overflow. Blocking caller.";
execution_queue_.push(priority, function);
}
catch(...){}
#define CASPAR_LOG_CURRENT_EXCEPTION() try{\
- CASPAR_LOG(error) << caspar::u16(boost::current_exception_diagnostic_information()) << L"Caught at (" << caspar::get_thread_info().name << L"):\n" << caspar::get_call_stack();\
+ CASPAR_LOG(error) << caspar::u16(boost::current_exception_diagnostic_information()) << L"Caught at (" << caspar::get_thread_info().name << L"):\n" << caspar::get_call_stack();\
}\
catch(...){}
-
+
+#define CASPAR_LOG_CURRENT_EXCEPTION_AT_LEVEL(lvl) try{\
+ CASPAR_LOG(lvl) << caspar::u16(boost::current_exception_diagnostic_information()) << L"Caught at (" << caspar::get_thread_info().name << L"):\n" << caspar::get_call_stack();\
+ }\
+ catch(...){}
+
void set_log_level(const std::wstring& lvl);
void print_child(
ensure_gpf_handler_installed_for_thread(u8(L"Destroyer: " + str).c_str());
if (!consumer->unique())
- CASPAR_LOG(trace) << str << L" Not destroyed on asynchronous destruction thread: " << consumer->use_count();
+ CASPAR_LOG(debug) << str << L" Not destroyed on asynchronous destruction thread: " << consumer->use_count();
else
- CASPAR_LOG(trace) << str << L" Destroying on asynchronous destruction thread.";
+ CASPAR_LOG(debug) << str << L" Destroying on asynchronous destruction thread.";
}
catch(...){}
~print_consumer_proxy()
{
auto str = consumer_->print();
- CASPAR_LOG(trace) << str << L" Uninitializing.";
+ CASPAR_LOG(debug) << str << L" Uninitializing.";
consumer_.reset();
CASPAR_LOG(info) << str << L" Uninitialized.";
}
{
if (input_frame.size() != format_desc_.size)
{
- CASPAR_LOG(debug) << print() << L" Invalid input frame dimension.";
+ CASPAR_LOG(warning) << print() << L" Invalid input frame dimension.";
return nullptr;
}
if (item.channel_layout == audio_channel_layout::invalid())
{
- CASPAR_LOG(debug) << "[audio_mixer] invalid audio channel layout for item";
+ CASPAR_LOG(warning) << "[audio_mixer] invalid audio channel layout for item";
+ next_audio_streams[tag].remapping_failed = true;
continue;
}
ensure_gpf_handler_installed_for_thread(u8(L"Destroyer: " + str).c_str());
if (!producer->unique())
- CASPAR_LOG(trace) << str << L" Not destroyed on asynchronous destruction thread: " << producer->use_count();
+ CASPAR_LOG(debug) << str << L" Not destroyed on asynchronous destruction thread: " << producer->use_count();
else
- CASPAR_LOG(trace) << str << L" Destroying on asynchronous destruction thread.";
+ CASPAR_LOG(debug) << str << L" Destroying on asynchronous destruction thread.";
}
catch(...){}
}
catch (...)
{
- CASPAR_LOG(debug) << L"Thumbnail producer failed to initialize for " << media_file_with_extension;
+ CASPAR_LOG_CURRENT_EXCEPTION_AT_LEVEL(debug);
+ CASPAR_LOG(info) << L"Thumbnail producer failed to initialize for " << media_file_with_extension << L". Turn on log level debug to see more information.";
return;
}
if (producer == frame_producer::empty())
{
- CASPAR_LOG(trace) << L"No appropriate thumbnail producer found for " << media_file_with_extension;
+ CASPAR_LOG(debug) << L"No appropriate thumbnail producer found for " << media_file_with_extension;
return;
}
}
catch (...)
{
- CASPAR_LOG(debug) << L"Thumbnail producer failed to create thumbnail for " << media_file_with_extension;
+ CASPAR_LOG_CURRENT_EXCEPTION_AT_LEVEL(debug);
+ CASPAR_LOG(info) << L"Thumbnail producer failed to create thumbnail for " << media_file_with_extension << L". Turn on log level debug to see more information.";
return;
}
try
{
boost::filesystem::last_write_time(png_file, boost::filesystem::last_write_time(file));
- CASPAR_LOG(debug) << L"Generated thumbnail for " << media_file_with_extension;
+ CASPAR_LOG(info) << L"Generated thumbnail for " << media_file_with_extension;
}
catch (...)
{
for (int i = 0; i < output.num_channels; ++i)
result << L"|c" << i << L"=c" << i;
- CASPAR_LOG(trace) << "[audio_channel_remapper] Passthru " << input.num_channels << " channels into " << output.num_channels;
+ CASPAR_LOG(debug) << "[audio_channel_remapper] Passthru " << input.num_channels << " channels into " << output.num_channels;
return result.str();
}
}
- CASPAR_LOG(trace) << L"[audio_channel_remapper] Using mix config: " << *mix_config;
+ CASPAR_LOG(debug) << L"[audio_channel_remapper] Using mix config: " << *mix_config;
// Split on | to find the output sections
std::vector<std::wstring> output_sections;
if (output_layout_ == audio_channel_layout::invalid())
CASPAR_THROW_EXCEPTION(invalid_argument() << msg_info(L"Output audio channel layout is invalid"));
- CASPAR_LOG(trace) << L"[audio_channel_remapper] Input: " << input_layout_.print();
- CASPAR_LOG(trace) << L"[audio_channel_remapper] Output: " << output_layout_.print();
+ CASPAR_LOG(debug) << L"[audio_channel_remapper] Input: " << input_layout_.print();
+ CASPAR_LOG(debug) << L"[audio_channel_remapper] Output: " << output_layout_.print();
if (!the_same_layouts_)
{
auto mix_config = mix_repo->get_config(input_layout_.type, output_layout_.type);
auto pan_filter = u8(generate_pan_filter_str(input_layout_, output_layout_, mix_config));
- CASPAR_LOG(trace) << "[audio_channel_remapper] Using audio filter: " << pan_filter;
+ CASPAR_LOG(debug) << "[audio_channel_remapper] Using audio filter: " << pan_filter;
auto logging_disabled = ffmpeg::temporary_disable_logging_for_thread(true);
filter_.reset(new ffmpeg::audio_filter(
boost::rational<int>(1, 1),
pan_filter));
}
else
- CASPAR_LOG(trace) << "[audio_channel_remapper] No remapping/mixing needed because the input and output layout is equal.";
+ CASPAR_LOG(debug) << "[audio_channel_remapper] No remapping/mixing needed because the input and output layout is equal.";
}
audio_buffer mix_and_rearrange(audio_buffer input)
filename = find_template(filename);
auto str = (boost::wformat(L"<invoke name=\"Add\" returntype=\"xml\"><arguments><number>%1%</number><string>%2%</string>%3%<string>%4%</string><string><![CDATA[%5%]]></string></arguments></invoke>") % layer % filename % (play_on_load ? L"<true/>" : L"<false/>") % label % data).str();
- CASPAR_LOG(info) << flash_producer_->print() << " Invoking add-command: " << str;
+ CASPAR_LOG(debug) << flash_producer_->print() << " Invoking add-command: " << str;
std::vector<std::wstring> params;
params.push_back(std::move(str));
flash_producer_->call(std::move(params)).get();
void remove(int layer) override
{
auto str = (boost::wformat(L"<invoke name=\"Delete\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array></arguments></invoke>") % layer).str();
- CASPAR_LOG(info) << flash_producer_->print() << " Invoking remove-command: " << str;
+ CASPAR_LOG(debug) << flash_producer_->print() << " Invoking remove-command: " << str;
std::vector<std::wstring> params;
params.push_back(std::move(str));
flash_producer_->call(std::move(params));
void play(int layer) override
{
auto str = (boost::wformat(L"<invoke name=\"Play\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array></arguments></invoke>") % layer).str();
- CASPAR_LOG(info) << flash_producer_->print() << " Invoking play-command: " << str;
+ CASPAR_LOG(debug) << flash_producer_->print() << " Invoking play-command: " << str;
std::vector<std::wstring> params;
params.push_back(std::move(str));
flash_producer_->call(std::move(params));
void stop(int layer, unsigned int) override
{
auto str = (boost::wformat(L"<invoke name=\"Stop\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array><number>0</number></arguments></invoke>") % layer).str();
- CASPAR_LOG(info) << flash_producer_->print() << " Invoking stop-command: " << str;
+ CASPAR_LOG(debug) << flash_producer_->print() << " Invoking stop-command: " << str;
std::vector<std::wstring> params;
params.push_back(std::move(str));
flash_producer_->call(std::move(params));
void next(int layer) override
{
auto str = (boost::wformat(L"<invoke name=\"Next\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array></arguments></invoke>") % layer).str();
- CASPAR_LOG(info) << flash_producer_->print() << " Invoking next-command: " << str;
+ CASPAR_LOG(debug) << flash_producer_->print() << " Invoking next-command: " << str;
std::vector<std::wstring> params;
params.push_back(std::move(str));
flash_producer_->call(std::move(params));
void update(int layer, const std::wstring& data) override
{
auto str = (boost::wformat(L"<invoke name=\"SetData\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array><string><![CDATA[%2%]]></string></arguments></invoke>") % layer % data).str();
- CASPAR_LOG(info) << flash_producer_->print() << " Invoking update-command: " << str;
+ CASPAR_LOG(debug) << flash_producer_->print() << " Invoking update-command: " << str;
std::vector<std::wstring> params;
params.push_back(std::move(str));
flash_producer_->call(std::move(params));
std::wstring invoke(int layer, const std::wstring& label) override
{
auto str = (boost::wformat(L"<invoke name=\"Invoke\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array><string>%2%</string></arguments></invoke>") % layer % label).str();
- CASPAR_LOG(info) << flash_producer_->print() << " Invoking invoke-command: " << str;
+ CASPAR_LOG(debug) << flash_producer_->print() << " Invoking invoke-command: " << str;
std::vector<std::wstring> params;
params.push_back(std::move(str));
// TODO: because of std::async deferred timed waiting does not work so for now we have to block
std::wstring description(int layer) override
{
auto str = (boost::wformat(L"<invoke name=\"GetDescription\" returntype=\"xml\"><arguments><array><property id=\"0\"><number>%1%</number></property></array></arguments></invoke>") % layer).str();
- CASPAR_LOG(info) << flash_producer_->print() << " Invoking description-command: " << str;
+ CASPAR_LOG(debug) << flash_producer_->print() << " Invoking description-command: " << str;
std::vector<std::wstring> params;
params.push_back(std::move(str));
// TODO: because of std::async deferred timed waiting does not work so for now we have to block
std::wstring template_host_info() override
{
auto str = (boost::wformat(L"<invoke name=\"GetInfo\" returntype=\"xml\"><arguments></arguments></invoke>")).str();
- CASPAR_LOG(info) << flash_producer_->print() << " Invoking info-command: " << str;
+ CASPAR_LOG(debug) << flash_producer_->print() << " Invoking info-command: " << str;
std::vector<std::wstring> params;
params.push_back(std::move(str));
// TODO: because of std::async deferred timed waiting does not work so for now we have to block
}
else if(str.find(L"OnCommand") != std::wstring::npos) {
//this is how templatehost 1.8 reports that a command has been received
- CASPAR_LOG(debug) << print_() << L" [command] " << str;
+ CASPAR_LOG(info) << print_() << L" [command] " << str;
bCallSuccessful_ = true;
}
else if(str.find(L"Activity") != std::wstring::npos)
{
- CASPAR_LOG(debug) << print_() << L" [activity] " << str;
+ CASPAR_LOG(info) << print_() << L" [activity] " << str;
//this is how templatehost 1.7 reports that a command has been received
if(str.find(L"Command recieved") != std::wstring::npos)
}
else if(str.find(L"IsEmpty") != std::wstring::npos)
{
- CASPAR_LOG(trace) << print_() << L" Empty.";
+ CASPAR_LOG(debug) << print_() << L" Empty.";
ATLTRACE(_T("ShockwaveFlash::IsEmpty\n"));
bIsEmpty_ = true;
}
{
std::wstring result;
- CASPAR_LOG(trace) << print() << " Call: " << param;
+ CASPAR_LOG(debug) << print() << " Call: " << param;
if(!ax_->FlashCall(param, result))
CASPAR_LOG(warning) << print() << L" Flash call failed:" << param;//CASPAR_THROW_EXCEPTION(invalid_operation() << msg_info("Flash function call failed.") << arg_name_info("param") << arg_value_info(narrow(param)));
load(load_image(description_));
if (thumbnail_mode)
- CASPAR_LOG(trace) << print() << L" Initialized";
+ CASPAR_LOG(debug) << print() << L" Initialized";
else
CASPAR_LOG(info) << print() << L" Initialized";
}
GetModuleFileNameW(module, actualFilename, sizeof(actualFilename));
- CASPAR_LOG(debug) << L"Loaded " << actualFilename;
+ CASPAR_LOG(info) << L"Loaded " << actualFilename;
create = reinterpret_cast<decltype(create)>(
GetProcAddress(module, "AirSend_Create"));
void set_name(const std::string& str)
{
name.assign(str.begin(), str.end());
- CASPAR_LOG(trace) << get_indent() << name;
+ CASPAR_LOG(debug) << get_indent() << name;
}
void add_char(std::uint8_t c)
void set_value()
{
- CASPAR_LOG(trace) << get_indent() << value;
+ CASPAR_LOG(debug) << get_indent() << value;
stack.back()->push_back(std::make_pair(name, Ptree(value)));
clear_state();
}
if (pCurrentCommand->Execute())
- CASPAR_LOG(debug) << "Executed command (" << timer.elapsed() << "s): " << print;
+ CASPAR_LOG(info) << "Executed command (" << timer.elapsed() << "s): " << print;
else
CASPAR_LOG(warning) << "Failed to execute command: " << print;
}
catch (file_not_found&)
{
+ CASPAR_LOG_CURRENT_EXCEPTION_AT_LEVEL(debug);
CASPAR_LOG(error) << L"File not found. No match found for parameters. Check syntax.";
pCurrentCommand->SetReplyString(L"404 " + pCurrentCommand->print() + L" FAILED\r\n");
}
catch (const user_error& e)
{
+ CASPAR_LOG_CURRENT_EXCEPTION_AT_LEVEL(debug);
CASPAR_LOG(error) << *boost::get_error_info<msg_info_t>(e) << ". Check syntax.";
pCurrentCommand->SetReplyString(L"403 " + pCurrentCommand->print() + L" FAILED\r\n");
}
catch (std::out_of_range&)
{
+ CASPAR_LOG_CURRENT_EXCEPTION_AT_LEVEL(debug);
CASPAR_LOG(error) << L"Missing parameter. Check syntax.";
pCurrentCommand->SetReplyString(L"402 " + pCurrentCommand->print() + L" FAILED\r\n");
}
catch (...)
{
CASPAR_LOG_CURRENT_EXCEPTION();
- CASPAR_LOG(warning) << "Failed to execute command:" << pCurrentCommand->print();
+ CASPAR_LOG(error) << "Failed to execute command:" << pCurrentCommand->print();
pCurrentCommand->SetReplyString(L"501 " + pCurrentCommand->print() + L" FAILED\r\n");
}
TitleList::iterator it = std::find(titles_.begin(), titles_.end(), titleName);
if(it != titles_.end()) {
- CASPAR_LOG(debug) << L"Found title with name " << it->titleName;
+ CASPAR_LOG(info) << L"Found title with name " << it->titleName;
result = (*it).pframe_producer;
}
else
void CIIProtocolStrategy::PutPreparedTemplate(const std::wstring& titleName, const spl::shared_ptr<core::frame_producer>& pFP)
{
- CASPAR_LOG(debug) << L"Saved title with name " << titleName;
+ CASPAR_LOG(info) << L"Saved title with name " << titleName;
TitleList::iterator it = std::find(titles_.begin(), titles_.end(), titleName);
if(it != titles_.end()) {
if (!command_processor_.handle(command_name_, parameters_))
CASPAR_LOG(error) << "CLK: Unknown command: " << command_name_;
else
- CASPAR_LOG(debug) << L"CLK: Executed valid command: "
+ CASPAR_LOG(info) << L"CLK: Executed valid command: "
<< currentCommandString_.str();
}
catch (...)
cg_registry_->get_proxy(channel_, core::cg_proxy::DEFAULT_LAYER)->update(0, data);\r
}\r
\r
- CASPAR_LOG(debug) << L"CLK: Clockdata sent: " << data;\r
+ CASPAR_LOG(info) << L"CLK: Clockdata sent: " << data;\r
}\r
\r
void reset()\r
~connection()
{
- CASPAR_LOG(trace) << print() << L" connection destroyed.";
+ CASPAR_LOG(debug) << print() << L" connection destroyed.";
}
std::wstring print() const
return spl::make_shared<to_unicode_adapter>(codepage_, unicode_strategy_factory_->create(client));\r
}\r
\r
-/*class legacy_client_info : public ClientInfo\r
-{\r
- client_connection<wchar_t>::ptr client_connection_;\r
-public:\r
- legacy_client_info(const client_connection<wchar_t>::ptr& client_connection)\r
- : client_connection_(client_connection)\r
- {\r
- CASPAR_LOG(info) << "legacy_client_info created.";\r
- }\r
-\r
- ~legacy_client_info()\r
- {\r
- CASPAR_LOG(info) << "legacy_client_info destroyed.";\r
- }\r
-\r
-\r
- virtual void Disconnect()\r
- {\r
- client_connection_->disconnect();\r
- }\r
-\r
- virtual void Send(const std::wstring& data)\r
- {\r
- client_connection_->send(std::wstring(data));\r
- }\r
-\r
- virtual std::wstring print() const \r
- {\r
- return client_connection_->print();\r
- }\r
- virtual void add_lifecycle_bound_object(const std::wstring& key, const std::shared_ptr<void>& lifecycle_bound)\r
- {\r
- client_connection_->add_lifecycle_bound_object(key, lifecycle_bound);\r
- }\r
- virtual std::shared_ptr<void> remove_lifecycle_bound_object(const std::wstring& key)\r
- {\r
- return client_connection_->remove_lifecycle_bound_object(key);\r
- }\r
-\r
-};*/\r
-\r
class legacy_strategy_adapter : public protocol_strategy<wchar_t>\r
{\r
ProtocolStrategyPtr strategy_;\r
env::configure(config_file_name);
- log::set_log_level(env::properties().get(L"configuration.log-level", L"debug"));
+ log::set_log_level(env::properties().get(L"configuration.log-level", L"info"));
if (env::properties().get(L"configuration.debugging.remote", false))
wait_for_remote_debugging();