diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2011-11-29 04:52:52 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander@sulfrian.net> | 2013-01-05 17:17:50 +0100 |
commit | 53bd23d0e679746b78d0bcf9234e7b99983e6071 (patch) | |
tree | 51dd89aba98e57c026046fdfbe25ba72aab974a6 /src/base/song.cpp | |
parent | a9c3f18ebc1dbb1de5c7c9d1585347ed25cc2b52 (diff) | |
download | usdx-53bd23d0e679746b78d0bcf9234e7b99983e6071.tar.gz usdx-53bd23d0e679746b78d0bcf9234e7b99983e6071.tar.xz usdx-53bd23d0e679746b78d0bcf9234e7b99983e6071.zip |
ported from log4cxx to log4cpp
log4cxx depends on Apache Portable Runtime Utility Library, so we
switch to log4cpp with nearly the same features but with no
dependencies for easier porting to other platforms
Diffstat (limited to '')
-rw-r--r-- | src/base/song.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/base/song.cpp b/src/base/song.cpp index 209f13de..af7e90a5 100644 --- a/src/base/song.cpp +++ b/src/base/song.cpp @@ -30,8 +30,8 @@ namespace usdx { - log4cxx::LoggerPtr Song::log = - log4cxx::Logger::getLogger("usdx.base.Song"); + log4cpp::Category& Song::log = + log4cpp::Category::getInstance("usdx.base.Song"); const boost::filesystem::wpath& Song::get_filename(void) const { @@ -98,7 +98,7 @@ namespace usdx lyrics.clear(); } - std::string Song::get_header_tag(const std::string& tag, const bool required) + std::string Song::get_header_tag(const std::string& tag, const bool required) { std::map<std::string, std::string>::iterator it; std::string result = ""; @@ -108,9 +108,9 @@ namespace usdx custom_header_tags.erase(it); } else if (required) { - LOG4CXX_ERROR(log, "Incomplete Song! Missing '" << tag << "' Tag in: '" << - get_filename() << "'"); - throw MissingTagException(tag, "Incomplete Song! Missing Tag."); + log << log4cpp::Priority::ERROR << "Incomplete Song! Missing '" << + tag << "' Tag in: '" << get_filename() << "'"; + throw MissingTagException(tag, "Incomplete Song! Missing Tag."); } return result; @@ -126,8 +126,8 @@ namespace usdx custom_header_tags.erase(it); } else if (required) { - LOG4CXX_ERROR(log, "Incomplete Song! Missing '" << tag << "' Tag in: '" << - get_filename() << "'"); + log << log4cpp::Priority::ERROR << "Incomplete Song! Missing '" << + tag << "' Tag in: '" << get_filename() << "'"; throw MissingTagException(tag, "Incomplete Song! Missing Tag."); } @@ -145,8 +145,8 @@ namespace usdx stream >> result; } else if (required) { - LOG4CXX_ERROR(log, "Incomplete Song! Missing '" << tag << "' Tag in: '" << - get_filename() << "'"); + log << log4cpp::Priority::ERROR << "Incomplete Song! Missing '" << + tag << "' Tag in: '" << get_filename() << "'"; throw MissingTagException(tag, "Incomplete Song! Missing Tag."); } @@ -167,8 +167,8 @@ namespace usdx custom_header_tags.erase(it); } else if (required) { - LOG4CXX_ERROR(log, "Incomplete Song! Missing '" << tag << "' Tag in: '" << - get_filename() << "'"); + log << log4cpp::Priority::ERROR << "Incomplete Song! Missing '" << + tag << "' Tag in: '" << get_filename() << "'"; throw MissingTagException(tag, "Incomplete Song! Missing Tag."); } |