24#include <boost/optional.hpp>
55 virtual void Log(
Severity severity,
const std::string &message,
const boost::optional<Location>& location) = 0;
57 virtual void Trace(
const std::string& message,
const boost::optional<Location>& location = boost::optional<Location>{});
58 virtual void Debug(
const std::string& message,
const boost::optional<Location>& location = boost::optional<Location>{});
59 virtual void Info(
const std::string& message,
const boost::optional<Location>& location = boost::optional<Location>{});
60 virtual void Warning(
const std::string& message,
const boost::optional<Location>& location = boost::optional<Location>{});
61 virtual void Error(
const std::string& message,
const boost::optional<Location>& location = boost::optional<Location>{});
62 virtual void Fatal(
const std::string& message,
const boost::optional<Location>& location = boost::optional<Location>{});
65 template<
typename... T>
66 void Tracef(
const boost::optional<Location>& location,
const std::string& pattern, T&&...args) {
70 template<
typename... T>
71 void Debugf(
const boost::optional<Location>& location,
const std::string& pattern, T&&...args) {
75 template<
typename... T>
76 void Infof(
const boost::optional<Location>& location,
const std::string& pattern, T&&...args) {
80 template<
typename... T>
81 void Warningf(
const boost::optional<Location>& location,
const std::string& pattern, T&&...args) {
85 template<
typename... T>
86 void Errorf(
const boost::optional<Location>& location,
const std::string& pattern, T&&...args) {
90 template<
typename... T>
91 void Fatalf(
const boost::optional<Location>& location,
const std::string& pattern, T&&...args) {
109void SetLogger(
const std::shared_ptr<Logger>& logger);
111#define TRACE(...) Log().Tracef(Logger::Location{__FILE__, __FUNCTION__, __LINE__}, __VA_ARGS__)
112#define DEBUG(...) Log().Debugf(Logger::Location{__FILE__, __FUNCTION__, __LINE__}, __VA_ARGS__)
113#define INFO(...) Log().Infof(Logger::Location{__FILE__, __FUNCTION__, __LINE__}, __VA_ARGS__)
114#define WARNING(...) Log().Warningf(Logger::Location{__FILE__, __FUNCTION__, __LINE__}, __VA_ARGS__)
115#define ERROR(...) Log().Errorf(Logger::Location{__FILE__, __FUNCTION__, __LINE__}, __VA_ARGS__)
116#define FATAL(...) Log().Fatalf(Logger::Location{__FILE__, __FUNCTION__, __LINE__}, __VA_ARGS__)
121#define MH_TRACE(...) core::ubuntu::media::Log().Tracef(\
122 core::ubuntu::media::Logger::Location{__FILE__, __FUNCTION__, __LINE__}, __VA_ARGS__)
123#define MH_DEBUG(...) core::ubuntu::media::Log().Debugf(\
124 core::ubuntu::media::Logger::Location{__FILE__, __FUNCTION__, __LINE__}, __VA_ARGS__)
125#define MH_INFO(...) core::ubuntu::media::Log().Infof(\
126 core::ubuntu::media::Logger::Location{__FILE__, __FUNCTION__, __LINE__}, __VA_ARGS__)
127#define MH_WARNING(...) core::ubuntu::media::Log().Warningf(core::ubuntu::media::Logger::Location{__FILE__, __FUNCTION__, __LINE__}, __VA_ARGS__)
128#define MH_ERROR(...) core::ubuntu::media::Log().Errorf(core::ubuntu::media::Logger::Location{__FILE__, __FUNCTION__, __LINE__}, __VA_ARGS__)
129#define MH_FATAL(...) core::ubuntu::media::Log().Fatalf(core::ubuntu::media::Logger::Location{__FILE__, __FUNCTION__, __LINE__}, __VA_ARGS__)