diff options
author | David Robillard <d@drobilla.net> | 2012-08-17 02:14:07 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-08-17 02:14:07 +0000 |
commit | 882245f41683924d0465b5afac2f8bb5c3786e60 (patch) | |
tree | 3220e84c90168eadaa7ccbaec06c1dc7ca1aacda /src | |
parent | 137a7fac329b7ca70babf00823efe431035a7657 (diff) | |
download | raul-882245f41683924d0465b5afac2f8bb5c3786e60.tar.gz raul-882245f41683924d0465b5afac2f8bb5c3786e60.tar.bz2 raul-882245f41683924d0465b5afac2f8bb5c3786e60.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/log.cpp | 83 |
1 files changed, 0 insertions, 83 deletions
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 <http://drobilla.net> - - 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 <http://www.gnu.org/licenses/>. -*/ - -#include <sstream> -#include <string> - -#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 |