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).
This commit is contained in:
Thiago Marcos P. Santos
2015-03-09 16:15:18 +02:00
committed by Thiago Marcos P. Santos
parent 2948e7d121
commit 51bc265db3
13 changed files with 33 additions and 121 deletions

View File

@@ -5,15 +5,10 @@
#include <mbgl/platform/default/headless_view.hpp>
#include <mbgl/platform/default/headless_display.hpp>
#include <mbgl/platform/log.hpp>
#include <mbgl/storage/default_file_source.hpp>
#include <mbgl/storage/default/sqlite_cache.hpp>
#if __APPLE__
#include <mbgl/platform/darwin/log_nslog.hpp>
#else
#include <mbgl/platform/default/log_stderr.hpp>
#endif
#pragma GCC diagnostic push
#ifndef __clang__
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
@@ -71,13 +66,6 @@ int main(int argc, char *argv[]) {
using namespace mbgl;
#if __APPLE__
Log::Set<NSLogBackend>();
#else
Log::Set<StderrLogBackend>();
#endif
mbgl::SQLiteCache cache(cache_file);
mbgl::DefaultFileSource fileSource(&cache);