From 882245f41683924d0465b5afac2f8bb5c3786e60 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 17 Aug 2012 02:14:07 +0000 Subject: Implement real logging system, LV2 log extension support, and purge evil/ugly/untranslatable C++ stream printing. Remove coloured log stuff from Raul. git-svn-id: http://svn.drobilla.net/lad/trunk/raul@4717 a436a847-0d15-0410-975c-d299462d15a1 --- src/log.cpp | 83 ------------------------------------------------------------- 1 file changed, 83 deletions(-) delete mode 100644 src/log.cpp (limited to 'src/log.cpp') diff --git a/src/log.cpp b/src/log.cpp deleted file mode 100644 index 975dece..0000000 --- a/src/log.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* - This file is part of Raul. - Copyright 2007-2012 David Robillard - - Raul 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 3 of the License, or any later version. - - Raul 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 Raul. If not, see . -*/ - -#include -#include - -#include "raul/log.hpp" -#include "raul_config.h" - -namespace Raul { - -#ifdef RAUL_LOG_COLOUR - -LogBuffer info_buffer("", LogBuffer::GREEN); -LogBuffer warn_buffer("", LogBuffer::YELLOW); -LogBuffer error_buffer("", LogBuffer::RED); -#ifdef RAUL_LOG_DEBUG -LogBuffer debug_buffer("", LogBuffer::CYAN); -#else -NullBuffer debug_buffer; -#endif - -#else // !RAUL_LOG_COLOUR - -LogBuffer info_buffer("INFO: "); -LogBuffer warn_buffer("WARNING: "); -LogBuffer error_buffer("ERROR: "); -#ifdef RAUL_LOG_DEBUG -LogBuffer debug_buffer("DEBUG: "); -#else -NullBuffer debug_buffer; -#endif - -#endif // RAUL_LOG_COLOUR - -Raul::Log info(&info_buffer); -Raul::Log warn(&warn_buffer); -Raul::Log error(&error_buffer); -Raul::Log debug(&debug_buffer); - -std::string -Raul::LogBuffer::colour(Colour c) -{ - std::stringstream ss; - ss << "\033[0;" << _colour << "m"; - return ss.str(); -} - -std::string -Raul::LogBuffer::plain() -{ - return "\033[0m"; -} - -void -Raul::LogBuffer::emit() -{ - if (_colour != DEFAULT) - _out << std::string(colour(_colour)); - - _out << _prefix << _line; - - if (_colour != DEFAULT) - _out << plain(); - - _out << std::endl; - _line.clear(); -} - -} // namespace Raul -- cgit v1.2.1