Newer
Older
#include "../inc/Logger.h"
#include <Poco/Logger.h>
#include <Poco/Message.h>
Nick Draper
committed
#include <iostream>
Russell Taylor
committed
{
namespace Kernel
Logger::Logger(const std::string& name): _log(Poco::Logger::get(name))
{
_name = name;
}
void Logger::fatal(const std::string& msg)
{
Nick Draper
committed
try
{
_log.fatal(msg);
}
Nick Draper
committed
{
//failures in logging are not allowed to throw exceptions out of the logging class
std::cerr << e.what();
}
}
void Logger::critical(const std::string& msg)
{
Nick Draper
committed
try
{
_log.critical(msg);
}
Nick Draper
committed
{
//failures in logging are not allowed to throw exceptions out of the logging class
std::cerr << e.what();
}
}
void Logger::error(const std::string& msg)
{
Nick Draper
committed
try
{
_log.error(msg);
}
Nick Draper
committed
{
//failures in logging are not allowed to throw exceptions out of the logging class
std::cerr << e.what();
}
}
void Logger::warning(const std::string& msg)
{
Nick Draper
committed
try
{
_log.warning(msg);
}
Nick Draper
committed
{
//failures in logging are not allowed to throw exceptions out of the logging class
std::cerr << e.what();
}
}
void Logger::information(const std::string& msg)
{
Nick Draper
committed
try
{
_log.information(msg);
}
Nick Draper
committed
{
//failures in logging are not allowed to throw exceptions out of the logging class
std::cerr << e.what();
}
}
void Logger::debug(const std::string& msg)
{
Nick Draper
committed
try
{
_log.debug(msg);
}
Nick Draper
committed
{
//failures in logging are not allowed to throw exceptions out of the logging class
std::cerr << e.what();
}
void Logger::dump(const std::string& msg, const void* buffer, std::size_t length)
Nick Draper
committed
try
{
_log.dump(msg,buffer,length);
}
Nick Draper
committed
{
//failures in logging are not allowed to throw exceptions out of the logging class
std::cerr << e.what();
}
bool Logger::is(int level) const
{
Nick Draper
committed
try
{
Nick Draper
committed
}
Nick Draper
committed
{
//failures in logging are not allowed to throw exceptions out of the logging class
std::cerr << e.what();
}
}
void Logger::shutdown()
{
Nick Draper
committed
try
{
Poco::Logger::shutdown();
}
Nick Draper
committed
{
//failures in logging are not allowed to throw exceptions out of the logging class
std::cerr << e.what();
}
}
Logger& Logger::get(const std::string& name)
{
Logger* pLogger = new Logger(name);
return *pLogger;
}
Russell Taylor
committed
} // namespace Kernel
} // Namespace Mantid