diff options
author | Thiago Marcos P. Santos <tmpsantos@gmail.com> | 2015-03-09 16:15:18 +0200 |
---|---|---|
committer | Thiago Marcos P. Santos <thiago@mapbox.com> | 2015-03-12 13:28:41 +0200 |
commit | 51bc265db341f1d98b4fd46be80241771f854eb5 (patch) | |
tree | dc77abcdc9b423b59da94d32ae2afb0f57fb6f8d /src | |
parent | 2948e7d121343359b817d2fb0eb383e257ab84c8 (diff) | |
download | qtlocation-mapboxgl-51bc265db341f1d98b4fd46be80241771f854eb5.tar.gz |
Make the logging system static
No initialization is needed anymore and we can use the logging functions
safely at any point of the code (threading is not handled though, so you
might get multiplexed messages if you log from two threads
simultaneously).
Diffstat (limited to 'src')
-rw-r--r-- | src/mbgl/platform/log.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/mbgl/platform/log.cpp b/src/mbgl/platform/log.cpp index 71463dc2f9..4bbff8da5d 100644 --- a/src/mbgl/platform/log.cpp +++ b/src/mbgl/platform/log.cpp @@ -4,13 +4,11 @@ namespace mbgl { -std::unique_ptr<LogBackend> Log::Backend; - -void LogBackend::record(EventSeverity severity, Event event, const std::string &msg) { +void Log::record(EventSeverity severity, Event event, const std::string &msg) { record(severity, event, -1, msg); } -void LogBackend::record(EventSeverity severity, Event event, const char* format, ...) { +void Log::record(EventSeverity severity, Event event, const char* format, ...) { va_list args; va_start(args, format); char msg[4096]; @@ -20,8 +18,12 @@ void LogBackend::record(EventSeverity severity, Event event, const char* format, record(severity, event, -1, msg); } -void LogBackend::record(EventSeverity severity, Event event, int64_t code) { +void Log::record(EventSeverity severity, Event event, int64_t code) { record(severity, event, code, std::string()); } +void Log::record(EventSeverity severity, Event event, int64_t code, const std::string &msg) { + platformRecord(severity, event, code, msg); +} + } |