utility: Added ConsoleLogger

Adds the class ConsoleLogger, which logs LogMessages to std::cout. The
Application class creates and registers a ConsoleLogger on creation.

Output format:
<time> | <filename>:<line> <function>() | <type>: <message>

Example:
12:58:18 | Application.cpp:21 create() | INFO: hello world!
12:58:18 | Application.cpp:22 create() | WARNING: attention world!
12:58:18 | Application.cpp:23 create() | ERROR: world failed

review=4
reviewer=stalli, malte
This commit is contained in:
Eberhard Graether
2014-04-09 14:43:48 +02:00
parent 6b02f6ff87
commit 9902288cab
6 changed files with 87 additions and 10 deletions
+8 -1
View File
@@ -1,4 +1,7 @@
#include "Application.h"
#include "Application.h"
#include "utility/logging/ConsoleLogger.h"
#include "utility/logging/LogManager.h"
std::shared_ptr<Application> Application::create(std::shared_ptr<GuiElementFactory> guiElementFactory)
{
@@ -8,6 +11,10 @@ std::shared_ptr<Application> Application::create(std::shared_ptr<GuiElementFacto
ptr->m_graphAccess = std::make_shared<GraphAccess>();
ptr->m_componentManager =
ComponentManager::create(ptr->m_viewManager, guiElementFactory, ptr->m_codeAccess, ptr->m_graphAccess);
std::shared_ptr<ConsoleLogger> consoleLogger = std::make_shared<ConsoleLogger>();
LogManager::getInstance()->addLogger(consoleLogger);
return ptr;
}