Index: src/DefaultLogSystem.cpp |
=================================================================== |
rename from src/DefaultErrorCallback.cpp |
rename to src/DefaultLogSystem.cpp |
--- a/src/DefaultErrorCallback.cpp |
+++ b/src/DefaultLogSystem.cpp |
@@ -11,14 +11,35 @@ |
* 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 Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
*/ |
#include <iostream> |
-#include <AdblockPlus/DefaultErrorCallback.h> |
+#include <AdblockPlus/DefaultLogSystem.h> |
-void AdblockPlus::DefaultErrorCallback::operator()(const std::string& message) |
+void AdblockPlus::DefaultLogSystem::operator()(AdblockPlus::LogSystem::LogLevel logLevel, |
+ const std::string& message, const std::string& source) |
{ |
- std::cerr << "Error: " << message << std::endl; |
+ switch (logLevel) |
+ { |
+ case TRACE: |
+ std::cerr << "Traceback:" << std::endl; |
+ break; |
+ case LOG: |
+ break; |
+ case INFO: |
+ std::cerr << "Info: "; |
+ break; |
+ case WARN: |
+ std::cerr << "Warning: "; |
+ break; |
+ case ERROR: |
+ std::cerr << "Error: "; |
+ break; |
+ } |
+ std::cerr << message; |
+ if (source.size()) |
+ std::cerr << " at " << source; |
+ std::cerr << std::endl; |
} |