diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2021-12-21 17:48:05 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2021-12-21 17:53:57 +0300 |
commit | d66a6525c361d93de2f7878bad27cd78dff2ecfd (patch) | |
tree | d154e40cfd32e6112e3365776474356c828b383e /source/blender/blenkernel/intern/asset_catalog.cc | |
parent | 7e712b2d6a0d257d272ed35622b41d06274af8df (diff) |
Assets: log message when catalog definitions cannot be loaded
Log a message (via `CLOG`) when asset catalog definitions cannot be
loaded.
Reviewed by @jacqueslucke in D13633
Diffstat (limited to 'source/blender/blenkernel/intern/asset_catalog.cc')
-rw-r--r-- | source/blender/blenkernel/intern/asset_catalog.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/asset_catalog.cc b/source/blender/blenkernel/intern/asset_catalog.cc index aec622bb71f..79504edb50d 100644 --- a/source/blender/blenkernel/intern/asset_catalog.cc +++ b/source/blender/blenkernel/intern/asset_catalog.cc @@ -32,6 +32,10 @@ # include "BLI_winstuff.h" #endif +#include "CLG_log.h" + +static CLG_LogRef LOG = {"bke.asset_service"}; + namespace blender::bke { const CatalogFilePath AssetCatalogService::DEFAULT_CATALOG_FILENAME = "blender_assets.cats.txt"; @@ -311,6 +315,7 @@ void AssetCatalogService::load_from_disk(const CatalogFilePath &file_or_director BLI_stat_t status; if (BLI_stat(file_or_directory_path.data(), &status) == -1) { /* TODO(@sybren): throw an appropriate exception. */ + CLOG_WARN(&LOG, "path not found: %s", file_or_directory_path.data()); return; } @@ -337,6 +342,7 @@ void AssetCatalogService::load_directory_recursive(const CatalogFilePath &direct if (!BLI_exists(file_path.data())) { /* No file to be loaded is perfectly fine. */ + CLOG_INFO(&LOG, 2, "path not found: %s", file_path.data()); return; } @@ -826,6 +832,10 @@ void AssetCatalogDefinitionFile::parse_catalog_file( { std::fstream infile(catalog_definition_file_path); + if (!infile.is_open()) { + CLOG_ERROR(&LOG, "%s: unable to open file", catalog_definition_file_path.c_str()); + return; + } bool seen_version_number = false; std::string line; while (std::getline(infile, line)) { |