From 51bc265db341f1d98b4fd46be80241771f854eb5 Mon Sep 17 00:00:00 2001 From: "Thiago Marcos P. Santos" Date: Mon, 9 Mar 2015 16:15:18 +0200 Subject: 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). --- src/mbgl/platform/log.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/mbgl/platform') 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 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); +} + } -- cgit v1.2.1