Use passed-in spdlog logger.
This commit is contained in:
parent
3efd0a8113
commit
63109a5fbb
|
|
@ -100,6 +100,7 @@ namespace Cesium3DTiles {
|
|||
virtual CesiumAsync::Future<std::unique_ptr<RasterOverlayTileProvider>> createTileProvider(
|
||||
const CesiumAsync::AsyncSystem& asyncSystem,
|
||||
std::shared_ptr<IPrepareRendererResources> pPrepareRendererResources,
|
||||
std::shared_ptr<spdlog::logger> pLogger,
|
||||
RasterOverlay* pOwner
|
||||
) override;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
#include <gsl/span>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <spdlog/fwd.h>
|
||||
|
||||
namespace Cesium3DTiles {
|
||||
|
||||
|
|
@ -21,6 +22,7 @@ namespace Cesium3DTiles {
|
|||
/**
|
||||
* @brief Create the {@link TileContentLoadResult} from the given input data.
|
||||
*
|
||||
* @param pLogger The logger that receives details of loading errors and warnings.
|
||||
* @param context The {@link TileContext}.
|
||||
* @param tileID The {@link TileID}
|
||||
* @param tileBoundingVolume The tile {@link BoundingVolume}
|
||||
|
|
@ -33,6 +35,7 @@ namespace Cesium3DTiles {
|
|||
* @return The {@link TileContentLoadResult}
|
||||
*/
|
||||
static std::unique_ptr<TileContentLoadResult> load(
|
||||
std::shared_ptr<spdlog::logger> pLogger,
|
||||
const TileContext& context,
|
||||
const TileID& tileID,
|
||||
const BoundingVolume& tileBoundingVolume,
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
#include "Cesium3DTiles/BoundingVolume.h"
|
||||
#include <glm/mat4x4.hpp>
|
||||
#include <gsl/span>
|
||||
#include <spdlog/fwd.h>
|
||||
|
||||
namespace Cesium3DTiles {
|
||||
|
||||
|
|
@ -20,6 +21,7 @@ namespace Cesium3DTiles {
|
|||
public:
|
||||
/** @copydoc ExternalTilesetContent::load */
|
||||
static std::unique_ptr<TileContentLoadResult> load(
|
||||
std::shared_ptr<spdlog::logger> pLogger,
|
||||
const TileContext& context,
|
||||
const TileID& tileID,
|
||||
const BoundingVolume& tileBoundingVolume,
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ namespace Cesium3DTiles {
|
|||
virtual CesiumAsync::Future<std::unique_ptr<RasterOverlayTileProvider>> createTileProvider(
|
||||
const CesiumAsync::AsyncSystem& asyncSystem,
|
||||
std::shared_ptr<IPrepareRendererResources> pPrepareRendererResources,
|
||||
std::shared_ptr<spdlog::logger> pLogger,
|
||||
RasterOverlay* pOwner
|
||||
) override;
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
#include "CesiumAsync/AsyncSystem.h"
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <spdlog/fwd.h>
|
||||
|
||||
namespace Cesium3DTiles {
|
||||
|
||||
|
|
@ -82,7 +83,8 @@ namespace Cesium3DTiles {
|
|||
*/
|
||||
void createTileProvider(
|
||||
const CesiumAsync::AsyncSystem& asyncSystem,
|
||||
std::shared_ptr<IPrepareRendererResources> pPrepareRendererResources
|
||||
std::shared_ptr<IPrepareRendererResources> pPrepareRendererResources,
|
||||
std::shared_ptr<spdlog::logger> pLogger
|
||||
);
|
||||
|
||||
/**
|
||||
|
|
@ -99,6 +101,7 @@ namespace Cesium3DTiles {
|
|||
virtual CesiumAsync::Future<std::unique_ptr<RasterOverlayTileProvider>> createTileProvider(
|
||||
const CesiumAsync::AsyncSystem& asyncSystem,
|
||||
std::shared_ptr<IPrepareRendererResources> pPrepareRendererResources,
|
||||
std::shared_ptr<spdlog::logger> pLogger,
|
||||
RasterOverlay* pOwner
|
||||
) = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
#include <gsl/span>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <spdlog/fwd.h>
|
||||
|
||||
namespace Cesium3DTiles {
|
||||
class TileContent;
|
||||
|
|
@ -36,6 +37,7 @@ namespace Cesium3DTiles {
|
|||
* @brief The signature of a function that can create a {@link TileContentLoadResult}
|
||||
*/
|
||||
typedef std::unique_ptr<TileContentLoadResult> FactoryFunctionSignature(
|
||||
std::shared_ptr<spdlog::logger> pLogger,
|
||||
const TileContext& context,
|
||||
const TileID& tileID,
|
||||
const BoundingVolume& tileBoundingVolume,
|
||||
|
|
@ -108,6 +110,7 @@ namespace Cesium3DTiles {
|
|||
* data, and no factory function for the given content type.
|
||||
*/
|
||||
static std::unique_ptr<TileContentLoadResult> createContent(
|
||||
std::shared_ptr<spdlog::logger> pLogger,
|
||||
const TileContext& context,
|
||||
const TileID& tileID,
|
||||
const BoundingVolume& tileBoundingVolume,
|
||||
|
|
|
|||
|
|
@ -110,6 +110,7 @@ namespace Cesium3DTiles {
|
|||
virtual CesiumAsync::Future<std::unique_ptr<RasterOverlayTileProvider>> createTileProvider(
|
||||
const CesiumAsync::AsyncSystem& asyncSystem,
|
||||
std::shared_ptr<IPrepareRendererResources> pPrepareRendererResources,
|
||||
std::shared_ptr<spdlog::logger> pLogger,
|
||||
RasterOverlay* pOwner
|
||||
) override;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
#include "Cesium3DTiles/Library.h"
|
||||
#include <spdlog/sinks/base_sink.h>
|
||||
#include <spdlog/spdlog.h>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
|
||||
namespace CesiumAsync {
|
||||
class IAssetAccessor;
|
||||
|
|
@ -37,9 +36,9 @@ namespace Cesium3DTiles {
|
|||
std::shared_ptr<CesiumAsync::ITaskProcessor> pTaskProcessor;
|
||||
|
||||
/**
|
||||
* @brief An spdlog sink that will receive log messages.
|
||||
* @brief A spdlog logger that will receive log messages.
|
||||
*/
|
||||
std::shared_ptr<spdlog::sinks::base_sink<std::mutex>> pLogSink;
|
||||
std::shared_ptr<spdlog::logger> pLogger = spdlog::default_logger();
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@ namespace Cesium3DTiles {
|
|||
namespace {
|
||||
|
||||
void parseFeatureTableJsonData(
|
||||
const std::shared_ptr<spdlog::logger>& pLogger,
|
||||
tinygltf::Model& gltf,
|
||||
const gsl::span<const uint8_t>& featureTableJsonData)
|
||||
{
|
||||
|
|
@ -50,7 +51,7 @@ namespace Cesium3DTiles {
|
|||
}
|
||||
catch (const json::parse_error& error)
|
||||
{
|
||||
SPDLOG_ERROR("Error when parsing feature table JSON: {}", error.what());
|
||||
SPDLOG_LOGGER_ERROR(pLogger, "Error when parsing feature table JSON: {}", error.what());
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -76,6 +77,7 @@ namespace Cesium3DTiles {
|
|||
|
||||
|
||||
std::unique_ptr<TileContentLoadResult> Batched3DModelContent::load(
|
||||
std::shared_ptr<spdlog::logger> pLogger,
|
||||
const TileContext& context,
|
||||
const TileID& tileID,
|
||||
const BoundingVolume& tileBoundingVolume,
|
||||
|
|
@ -154,6 +156,7 @@ namespace Cesium3DTiles {
|
|||
|
||||
gsl::span<const uint8_t> glbData = data.subspan(glbStart, glbEnd - glbStart);
|
||||
std::unique_ptr<TileContentLoadResult> pResult = GltfContent::load(
|
||||
pLogger,
|
||||
context,
|
||||
tileID,
|
||||
tileBoundingVolume,
|
||||
|
|
@ -168,7 +171,7 @@ namespace Cesium3DTiles {
|
|||
if (pResult->model && header.featureTableJsonByteLength > 0) {
|
||||
tinygltf::Model& gltf = pResult->model.value();
|
||||
gsl::span<const uint8_t> featureTableJsonData = data.subspan(headerLength, header.featureTableJsonByteLength);
|
||||
parseFeatureTableJsonData(gltf, featureTableJsonData);
|
||||
parseFeatureTableJsonData(pLogger, gltf, featureTableJsonData);
|
||||
}
|
||||
|
||||
return pResult;
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
#include "Cesium3DTiles/TileContentLoadResult.h"
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <spdlog/fwd.h>
|
||||
|
||||
namespace Cesium3DTiles {
|
||||
|
||||
|
|
@ -19,6 +20,7 @@ namespace Cesium3DTiles {
|
|||
public:
|
||||
/** @copydoc ExternalTilesetContent::load */
|
||||
static std::unique_ptr<TileContentLoadResult> load(
|
||||
std::shared_ptr<spdlog::logger> pLogger,
|
||||
const TileContext& context,
|
||||
const TileID& tileID,
|
||||
const BoundingVolume& tileBoundingVolume,
|
||||
|
|
|
|||
|
|
@ -143,6 +143,7 @@ namespace Cesium3DTiles {
|
|||
Future<std::unique_ptr<RasterOverlayTileProvider>> BingMapsRasterOverlay::createTileProvider(
|
||||
const AsyncSystem& asyncSystem,
|
||||
std::shared_ptr<IPrepareRendererResources> pPrepareRendererResources,
|
||||
std::shared_ptr<spdlog::logger> pLogger,
|
||||
RasterOverlay* pOwner
|
||||
) {
|
||||
std::string metadataUrl = Uri::resolve(this->_url, "REST/v1/Imagery/Metadata/" + this->_mapStyle, true);
|
||||
|
|
@ -156,6 +157,7 @@ namespace Cesium3DTiles {
|
|||
pOwner,
|
||||
asyncSystem,
|
||||
pPrepareRendererResources,
|
||||
pLogger,
|
||||
baseUrl = this->_url,
|
||||
culture = this->_culture
|
||||
](std::unique_ptr<IAssetRequest> pRequest) -> std::unique_ptr<RasterOverlayTileProvider> {
|
||||
|
|
@ -166,7 +168,7 @@ namespace Cesium3DTiles {
|
|||
try {
|
||||
response = json::parse(pResponse->data().begin(), pResponse->data().end());
|
||||
} catch (const json::parse_error& error) {
|
||||
SPDLOG_ERROR("Error when parsing Bing maps raster overlay metadata: {}", error.what());
|
||||
SPDLOG_LOGGER_ERROR(pLogger, "Error when parsing Bing maps raster overlay metadata: {}", error.what());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
namespace Cesium3DTiles {
|
||||
|
||||
/*static*/ std::unique_ptr<TileContentLoadResult> ExternalTilesetContent::load(
|
||||
std::shared_ptr<spdlog::logger> pLogger,
|
||||
const TileContext& context,
|
||||
const TileID& /*tileID*/,
|
||||
const BoundingVolume& /*tileBoundingVolume*/,
|
||||
|
|
@ -39,7 +40,7 @@ namespace Cesium3DTiles {
|
|||
}
|
||||
catch (const json::parse_error& error)
|
||||
{
|
||||
SPDLOG_ERROR("Error when parsing external tileset content: {}", error.what());
|
||||
SPDLOG_LOGGER_ERROR(pLogger, "Error when parsing external tileset content: {}", error.what());
|
||||
}
|
||||
return pResult;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
namespace Cesium3DTiles {
|
||||
|
||||
/*static*/ std::unique_ptr<TileContentLoadResult> GltfContent::load(
|
||||
std::shared_ptr<spdlog::logger> pLogger,
|
||||
const TileContext& /*context*/,
|
||||
const TileID& /*tileID*/,
|
||||
const BoundingVolume& /*tileBoundingVolume*/,
|
||||
|
|
@ -28,10 +29,10 @@ namespace Cesium3DTiles {
|
|||
pResult->model.emplace();
|
||||
bool success = loader.LoadBinaryFromMemory(&pResult->model.value(), &errors, &warnings, data.data(), static_cast<unsigned int>(data.size()));
|
||||
if (!success) {
|
||||
SPDLOG_ERROR("Failed to load binary glTF from memory: {}", errors);
|
||||
SPDLOG_LOGGER_ERROR(pLogger, "Failed to load binary glTF from memory: {}", errors);
|
||||
}
|
||||
if (!warnings.empty()) {
|
||||
SPDLOG_WARN("Warning when loading binary glTF from memory: {}", warnings);
|
||||
SPDLOG_LOGGER_WARN(pLogger, "Warning when loading binary glTF from memory: {}", warnings);
|
||||
}
|
||||
return pResult;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ namespace Cesium3DTiles {
|
|||
Future<std::unique_ptr<RasterOverlayTileProvider>> IonRasterOverlay::createTileProvider(
|
||||
const AsyncSystem& asyncSystem,
|
||||
std::shared_ptr<IPrepareRendererResources> pPrepareRendererResources,
|
||||
std::shared_ptr<spdlog::logger> pLogger,
|
||||
RasterOverlay* pOwner
|
||||
) {
|
||||
std::string ionUrl = "https://api.cesium.com/v1/assets/" + std::to_string(this->_ionAssetID) + "/endpoint";
|
||||
|
|
@ -36,7 +37,9 @@ namespace Cesium3DTiles {
|
|||
|
||||
pOwner = pOwner ? pOwner : this;
|
||||
|
||||
return asyncSystem.requestAsset(ionUrl).thenInWorkerThread([](
|
||||
return asyncSystem.requestAsset(ionUrl).thenInWorkerThread([
|
||||
pLogger
|
||||
](
|
||||
std::unique_ptr<IAssetRequest> pRequest
|
||||
) -> std::unique_ptr<RasterOverlay> {
|
||||
IAssetResponse* pResponse = pRequest->response();
|
||||
|
|
@ -46,14 +49,14 @@ namespace Cesium3DTiles {
|
|||
try {
|
||||
response = json::parse(pResponse->data().begin(), pResponse->data().end());
|
||||
} catch (const json::parse_error& error) {
|
||||
SPDLOG_ERROR("Error when parsing ion raster overlay metadata JSON: {}", error.what());
|
||||
SPDLOG_LOGGER_ERROR(pLogger, "Error when parsing ion raster overlay metadata JSON: {}", error.what());
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::string type = response.value("type", "unknown");
|
||||
if (type != "IMAGERY") {
|
||||
// TODO: report invalid imagery type.
|
||||
SPDLOG_ERROR("Ion raster overlay metadata response type is not 'IMAGERY', but {}", type);
|
||||
SPDLOG_LOGGER_ERROR(pLogger, "Ion raster overlay metadata response type is not 'IMAGERY', but {}", type);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
@ -62,7 +65,7 @@ namespace Cesium3DTiles {
|
|||
json::iterator optionsIt = response.find("options");
|
||||
if (optionsIt == response.end()) {
|
||||
// TODO: report incomplete Bing options
|
||||
SPDLOG_ERROR("Ion raster overlay metadata response does not contain 'options'");
|
||||
SPDLOG_LOGGER_ERROR(pLogger, "Ion raster overlay metadata response does not contain 'options'");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
@ -90,9 +93,10 @@ namespace Cesium3DTiles {
|
|||
}).thenInMainThread([
|
||||
pOwner,
|
||||
asyncSystem,
|
||||
pPrepareRendererResources
|
||||
pPrepareRendererResources,
|
||||
pLogger
|
||||
](std::unique_ptr<RasterOverlay> pAggregatedOverlay) {
|
||||
return pAggregatedOverlay->createTileProvider(asyncSystem, pPrepareRendererResources, pOwner);
|
||||
return pAggregatedOverlay->createTileProvider(asyncSystem, pPrepareRendererResources, pLogger, pOwner);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -106,9 +106,15 @@ namespace Cesium3DTiles {
|
|||
return glm::normalize(result);
|
||||
}
|
||||
|
||||
static void processMetadata(const QuadtreeTileID& tileID, gsl::span<const char> json, TileContentLoadResult& result);
|
||||
static void processMetadata(
|
||||
const std::shared_ptr<spdlog::logger>& pLogger,
|
||||
const QuadtreeTileID& tileID,
|
||||
gsl::span<const char> json,
|
||||
TileContentLoadResult& result
|
||||
);
|
||||
|
||||
/*static*/ std::unique_ptr<TileContentLoadResult> QuantizedMeshContent::load(
|
||||
std::shared_ptr<spdlog::logger> pLogger,
|
||||
const TileContext& /*context*/,
|
||||
const TileID& tileID,
|
||||
const BoundingVolume& tileBoundingVolume,
|
||||
|
|
@ -429,7 +435,7 @@ namespace Cesium3DTiles {
|
|||
}
|
||||
|
||||
gsl::span<const char> json(reinterpret_cast<const char*>(data.data() + sizeof(uint32_t) + readIndex), jsonLength);
|
||||
processMetadata(id, json, *pResult);
|
||||
processMetadata(pLogger, id, json, *pResult);
|
||||
}
|
||||
|
||||
readIndex += extensionLength;
|
||||
|
|
@ -464,7 +470,12 @@ namespace Cesium3DTiles {
|
|||
json.at("endY").get_to(range.maximumY);
|
||||
}
|
||||
|
||||
static void processMetadata(const QuadtreeTileID& tileID, gsl::span<const char> metadataString, TileContentLoadResult& result) {
|
||||
static void processMetadata(
|
||||
const std::shared_ptr<spdlog::logger>& pLogger,
|
||||
const QuadtreeTileID& tileID,
|
||||
gsl::span<const char> metadataString,
|
||||
TileContentLoadResult& result
|
||||
) {
|
||||
using namespace nlohmann;
|
||||
json metadata;
|
||||
try
|
||||
|
|
@ -473,7 +484,7 @@ namespace Cesium3DTiles {
|
|||
}
|
||||
catch (const json::parse_error& error)
|
||||
{
|
||||
SPDLOG_ERROR("Error when parsing metadata: {}", error.what());
|
||||
SPDLOG_LOGGER_ERROR(pLogger, "Error when parsing metadata: {}", error.what());
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ namespace Cesium3DTiles {
|
|||
|
||||
/** @copydoc ExternalTilesetContent::load */
|
||||
static std::unique_ptr<TileContentLoadResult> load(
|
||||
std::shared_ptr<spdlog::logger> pLogger,
|
||||
const TileContext& context,
|
||||
const TileID& tileID,
|
||||
const BoundingVolume& tileBoundingVolume,
|
||||
|
|
|
|||
|
|
@ -27,7 +27,8 @@ namespace Cesium3DTiles {
|
|||
|
||||
void RasterOverlay::createTileProvider(
|
||||
const AsyncSystem& asyncSystem,
|
||||
std::shared_ptr<IPrepareRendererResources> pPrepareRendererResources
|
||||
std::shared_ptr<IPrepareRendererResources> pPrepareRendererResources,
|
||||
std::shared_ptr<spdlog::logger> pLogger
|
||||
) {
|
||||
if (this->_pPlaceholder) {
|
||||
return;
|
||||
|
|
@ -43,6 +44,7 @@ namespace Cesium3DTiles {
|
|||
this->createTileProvider(
|
||||
asyncSystem,
|
||||
pPrepareRendererResources,
|
||||
pLogger,
|
||||
this
|
||||
).thenInMainThread([this](std::unique_ptr<RasterOverlayTileProvider> pProvider) {
|
||||
this->_pTileProvider = std::move(pProvider);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,11 @@ namespace Cesium3DTiles {
|
|||
void RasterOverlayCollection::add(std::unique_ptr<RasterOverlay>&& pOverlay) {
|
||||
RasterOverlay* pOverlayRaw = pOverlay.get();
|
||||
this->_overlays.push_back(std::move(pOverlay));
|
||||
pOverlayRaw->createTileProvider(this->_pTileset->getAsyncSystem(), this->_pTileset->getExternals().pPrepareRendererResources);
|
||||
pOverlayRaw->createTileProvider(
|
||||
this->_pTileset->getAsyncSystem(),
|
||||
this->_pTileset->getExternals().pPrepareRendererResources,
|
||||
this->_pTileset->getExternals().pLogger
|
||||
);
|
||||
|
||||
// Add this overlay to existing geometry tiles.
|
||||
this->_pTileset->forEachLoadedTile([pOverlayRaw](Tile& tile) {
|
||||
|
|
|
|||
|
|
@ -233,7 +233,8 @@ namespace Cesium3DTiles {
|
|||
contentBoundingVolume = this->getContentBoundingVolume(),
|
||||
refine = this->getRefine(),
|
||||
projections = std::move(projections),
|
||||
pPrepareRendererResources = tileset.getExternals().pPrepareRendererResources
|
||||
pPrepareRendererResources = tileset.getExternals().pPrepareRendererResources,
|
||||
pLogger = tileset.getExternals().pLogger
|
||||
](std::unique_ptr<IAssetRequest>&& pRequest) {
|
||||
IAssetResponse* pResponse = pRequest->response();
|
||||
if (!pResponse) {
|
||||
|
|
@ -259,6 +260,7 @@ namespace Cesium3DTiles {
|
|||
}
|
||||
|
||||
std::unique_ptr<TileContentLoadResult> pContent = TileContentFactory::createContent(
|
||||
pLogger,
|
||||
*pContext,
|
||||
tileID,
|
||||
boundingVolume,
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ namespace Cesium3DTiles {
|
|||
}
|
||||
|
||||
std::unique_ptr<TileContentLoadResult> TileContentFactory::createContent(
|
||||
std::shared_ptr<spdlog::logger> pLogger,
|
||||
const TileContext& context,
|
||||
const TileID& tileID,
|
||||
const BoundingVolume& tileBoundingVolume,
|
||||
|
|
@ -36,19 +37,19 @@ namespace Cesium3DTiles {
|
|||
|
||||
auto itMagic = TileContentFactory::_factoryFunctionsByMagic.find(magic);
|
||||
if (itMagic != TileContentFactory::_factoryFunctionsByMagic.end()) {
|
||||
return itMagic->second(context, tileID, tileBoundingVolume, tileGeometricError, tileTransform, tileContentBoundingVolume, tileRefine, url, data);
|
||||
return itMagic->second(pLogger, context, tileID, tileBoundingVolume, tileGeometricError, tileTransform, tileContentBoundingVolume, tileRefine, url, data);
|
||||
}
|
||||
|
||||
std::string baseContentType = contentType.substr(0, contentType.find(';'));
|
||||
|
||||
auto itContentType = TileContentFactory::_factoryFunctionsByContentType.find(baseContentType);
|
||||
if (itContentType != TileContentFactory::_factoryFunctionsByContentType.end()) {
|
||||
return itContentType->second(context, tileID, tileBoundingVolume, tileGeometricError, tileTransform, tileContentBoundingVolume, tileRefine, url, data);
|
||||
return itContentType->second(pLogger, context, tileID, tileBoundingVolume, tileGeometricError, tileTransform, tileContentBoundingVolume, tileRefine, url, data);
|
||||
}
|
||||
|
||||
itMagic = TileContentFactory::_factoryFunctionsByMagic.find("json");
|
||||
if (itMagic != TileContentFactory::_factoryFunctionsByMagic.end()) {
|
||||
return itMagic->second(context, tileID, tileBoundingVolume, tileGeometricError, tileTransform, tileContentBoundingVolume, tileRefine, url, data);
|
||||
return itMagic->second(pLogger, context, tileID, tileBoundingVolume, tileGeometricError, tileTransform, tileContentBoundingVolume, tileRefine, url, data);
|
||||
}
|
||||
|
||||
// No content type registered for this magic or content type
|
||||
|
|
|
|||
|
|
@ -117,6 +117,7 @@ namespace Cesium3DTiles {
|
|||
Future<std::unique_ptr<RasterOverlayTileProvider>> TileMapServiceRasterOverlay::createTileProvider(
|
||||
const AsyncSystem& asyncSystem,
|
||||
std::shared_ptr<IPrepareRendererResources> pPrepareRendererResources,
|
||||
std::shared_ptr<spdlog::logger> pLogger,
|
||||
RasterOverlay* pOwner
|
||||
) {
|
||||
std::string xmlUrl = Uri::resolve(this->_url, "tilemapresource.xml");
|
||||
|
|
|
|||
|
|
@ -316,19 +316,20 @@ namespace Cesium3DTiles {
|
|||
}
|
||||
|
||||
this->_asyncSystem.requestAsset(url, headers).thenInWorkerThread([
|
||||
pLogger = this->getExternals().pLogger,
|
||||
pTileset = this,
|
||||
pContext = std::move(pContext)
|
||||
](std::unique_ptr<IAssetRequest>&& pRequest) mutable {
|
||||
IAssetResponse* pResponse = pRequest->response();
|
||||
if (!pResponse) {
|
||||
// TODO: report the lack of response. Network error? Can this even happen?
|
||||
SPDLOG_ERROR("Did not receive a valid response for tileset {}", pRequest->url());
|
||||
SPDLOG_LOGGER_ERROR(pLogger, "Did not receive a valid response for tileset {}", pRequest->url());
|
||||
return LoadResult { std::move(pContext), nullptr };
|
||||
}
|
||||
|
||||
if (pResponse->statusCode() < 200 || pResponse->statusCode() >= 300) {
|
||||
// TODO: report error response.
|
||||
SPDLOG_ERROR("Received status code {} for tileset {}", pResponse->statusCode(), pRequest->url());
|
||||
SPDLOG_LOGGER_ERROR(pLogger, "Received status code {} for tileset {}", pResponse->statusCode(), pRequest->url());
|
||||
return LoadResult { std::move(pContext), nullptr };
|
||||
}
|
||||
|
||||
|
|
@ -342,7 +343,7 @@ namespace Cesium3DTiles {
|
|||
try {
|
||||
tileset = json::parse(data.begin(), data.end());
|
||||
} catch (const json::parse_error& error) {
|
||||
SPDLOG_ERROR("Error when parsing tileset JSON: {}", error.what());
|
||||
SPDLOG_LOGGER_ERROR(pLogger, "Error when parsing tileset JSON: {}", error.what());
|
||||
return LoadResult { std::move(pContext), nullptr };
|
||||
}
|
||||
|
||||
|
|
@ -605,7 +606,7 @@ namespace Cesium3DTiles {
|
|||
try {
|
||||
ionResponse = json::parse(data.begin(), data.end());
|
||||
} catch (const json::parse_error& error) {
|
||||
SPDLOG_ERROR("Error when parsing ion response: {}", error.what());
|
||||
SPDLOG_LOGGER_ERROR(this->getExternals().pLogger, "Error when parsing ion response: {}", error.what());
|
||||
failedParsing = true;
|
||||
}
|
||||
if (!failedParsing) {
|
||||
|
|
|
|||
|
|
@ -17,5 +17,4 @@ add_subdirectory(tinyxml2)
|
|||
|
||||
add_subdirectory(asyncplusplus)
|
||||
|
||||
set(SPDLOG_BUILD_SHARED ON CACHE BOOL "Build spdlog shared" FORCE)
|
||||
add_subdirectory(spdlog)
|
||||
|
|
|
|||
Loading…
Reference in New Issue