summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2015-03-09 15:42:11 +0200
committerThiago Marcos P. Santos <thiago@mapbox.com>2015-03-12 13:28:40 +0200
commit2948e7d121343359b817d2fb0eb383e257ab84c8 (patch)
treef16ef0c923774abe4d2eb2c2e888ffe22238e926 /include
parentba9d2420699507c6d32b12272151529663c8d2fd (diff)
downloadqtlocation-mapboxgl-2948e7d121343359b817d2fb0eb383e257ab84c8.tar.gz
Simplify the logging mechanism
Move the implementation of the more specialized methods to the base class and let the platform implement only the most generic method that takes all the possible arguments. These specialized methods will then map to the generic implementation that must be provided by the platforms we support.
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/platform/darwin/log_nslog.hpp3
-rw-r--r--include/mbgl/platform/default/log_stderr.hpp5
-rw-r--r--include/mbgl/platform/log.hpp8
3 files changed, 6 insertions, 10 deletions
diff --git a/include/mbgl/platform/darwin/log_nslog.hpp b/include/mbgl/platform/darwin/log_nslog.hpp
index d40f963036..5b2ed04114 100644
--- a/include/mbgl/platform/darwin/log_nslog.hpp
+++ b/include/mbgl/platform/darwin/log_nslog.hpp
@@ -9,9 +9,6 @@ class NSLogBackend : public LogBackend {
public:
inline ~NSLogBackend() = default;
- void record(EventSeverity severity, Event event, const std::string &msg);
- void record(EventSeverity severity, Event event, const char* format, ...);
- void record(EventSeverity severity, Event event, int64_t code);
void record(EventSeverity severity, Event event, int64_t code, const std::string &msg);
};
diff --git a/include/mbgl/platform/default/log_stderr.hpp b/include/mbgl/platform/default/log_stderr.hpp
index 45f76f0d1a..e07357593d 100644
--- a/include/mbgl/platform/default/log_stderr.hpp
+++ b/include/mbgl/platform/default/log_stderr.hpp
@@ -9,10 +9,7 @@ class StderrLogBackend : public LogBackend {
public:
inline ~StderrLogBackend() = default;
- void record(EventSeverity severity, Event event, const std::string &msg);
- void record(EventSeverity severity, Event event, const char* format, ...);
- void record(EventSeverity severity, Event event, int64_t code);
- void record(EventSeverity severity, Event event, int64_t code, const std::string &msg);
+ void record(EventSeverity severity, Event event, int64_t code, const std::string &msg) override;
};
diff --git a/include/mbgl/platform/log.hpp b/include/mbgl/platform/log.hpp
index 8b58921bbe..e5431a07cb 100644
--- a/include/mbgl/platform/log.hpp
+++ b/include/mbgl/platform/log.hpp
@@ -13,9 +13,11 @@ namespace mbgl {
class LogBackend {
public:
virtual inline ~LogBackend() = default;
- virtual void record(EventSeverity severity, Event event, const std::string &msg) = 0;
- virtual void record(EventSeverity severity, Event event, const char* format, ...) = 0;
- virtual void record(EventSeverity severity, Event event, int64_t code) = 0;
+
+ void record(EventSeverity severity, Event event, const std::string &msg);
+ void record(EventSeverity severity, Event event, const char* format, ...);
+ void record(EventSeverity severity, Event event, int64_t code);
+
virtual void record(EventSeverity severity, Event event, int64_t code, const std::string &msg) = 0;
};