/* Copyright (C) 2006 Paul Davis Written by Tim Mayberry This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include using std::cerr; using std::endl; #include "log_viewer.h" using namespace sigc; LogViewer::LogViewer (const Glib::ustring& log_domain) : m_error_handler(log_domain, PBD::ERROR), m_warning_handler(log_domain, PBD::WARNING), m_info_handler(log_domain, PBD::INFO | PBD::DEBUG) { m_error_handler.signal_log_message().connect (mem_fun (*this, &LogViewer::error_message_handler)); m_warning_handler.signal_log_message().connect (mem_fun (*this, &LogViewer::warning_message_handler)); m_info_handler.signal_log_message().connect (mem_fun (*this, &LogViewer::info_message_handler)); } void LogViewer::error_message_handler (const Glib::ustring* message) { cerr << "ERROR: " << *message << endl; } void LogViewer::warning_message_handler (const Glib::ustring* message) { cerr << "WARNING: " << *message << endl; } void LogViewer::info_message_handler (const Glib::ustring* message) { cerr << "INFO: " << *message << endl; }