Removes unused JSON logger.
References: - https://github.com/Project-OSRM/osrm-backend/pull/2769
This commit is contained in:
committed by
Moritz Kobitzsch
parent
6cfd1c92e1
commit
d1f555dcef
@@ -9,7 +9,6 @@
|
||||
|
||||
#include "util/coordinate_calculation.hpp"
|
||||
#include "util/for_each_pair.hpp"
|
||||
#include "util/json_logger.hpp"
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
#ifndef JSON_LOGGER_HPP
|
||||
#define JSON_LOGGER_HPP
|
||||
|
||||
#include "osrm/json_container.hpp"
|
||||
|
||||
#include <boost/thread/tss.hpp>
|
||||
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
namespace util
|
||||
{
|
||||
namespace json
|
||||
{
|
||||
|
||||
// Used to append additional debugging information to the JSON response in a
|
||||
// thread safe manner.
|
||||
class Logger
|
||||
{
|
||||
using MapT = std::unordered_map<std::string, Value>;
|
||||
|
||||
public:
|
||||
static Logger *get()
|
||||
{
|
||||
static Logger logger;
|
||||
|
||||
bool return_logger = true;
|
||||
#ifdef NDEBUG
|
||||
return_logger = false;
|
||||
#endif
|
||||
#ifdef ENABLE_JSON_LOGGING
|
||||
return_logger = true;
|
||||
#endif
|
||||
|
||||
if (return_logger)
|
||||
{
|
||||
return &logger;
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void initialize(const std::string &name)
|
||||
{
|
||||
if (!map.get())
|
||||
{
|
||||
map.reset(new MapT());
|
||||
}
|
||||
(*map)[name] = Object();
|
||||
}
|
||||
|
||||
void render(const std::string &name, Object &obj) const { obj.values["debug"] = map->at(name); }
|
||||
|
||||
boost::thread_specific_ptr<MapT> map;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* JSON_LOGGER_HPP */
|
||||
Reference in New Issue
Block a user