Logging: Cycles: Change various warnings to errors

So that --debug-exit-on-error can be used to detect issues like missing
textures. Blender also reports such cases as errors now.

Pull Request: https://projects.blender.org/blender/blender/pulls/146507
This commit is contained in:
Brecht Van Lommel
2025-09-20 16:28:43 +02:00
committed by Brecht Van Lommel
parent 23539f457d
commit 613abf0383
6 changed files with 21 additions and 16 deletions

View File

@@ -386,7 +386,7 @@ static void ExportCurveSegments(Scene *scene, Hair *hair, ParticleCurveData *CDa
/* check allocation */
if ((hair->get_curve_keys().size() != num_keys) || (hair->num_curves() != num_curves)) {
LOG_WARNING << "Hair memory allocation failed, clearing data.";
LOG_ERROR << "Hair memory allocation failed, clearing data.";
hair->clear(true);
}
}

View File

@@ -339,12 +339,12 @@ string CUDADevice::compile_kernel(const string &common_cflags,
const int nvcc_cuda_version = cuewCompilerVersion();
LOG_INFO << "Found nvcc " << nvcc << ", CUDA version " << nvcc_cuda_version << ".";
if (nvcc_cuda_version < 101) {
LOG_WARNING << "Unsupported CUDA version " << nvcc_cuda_version / 10 << "."
LOG_ERROR << "Unsupported CUDA version " << nvcc_cuda_version / 10 << "."
<< nvcc_cuda_version % 10 << ", you need CUDA 10.1 or newer";
return string();
}
if (!(nvcc_cuda_version >= 102 && nvcc_cuda_version < 130)) {
LOG_WARNING << "CUDA version " << nvcc_cuda_version / 10 << "." << nvcc_cuda_version % 10
LOG_ERROR << "CUDA version " << nvcc_cuda_version / 10 << "." << nvcc_cuda_version % 10
<< "CUDA 10.1 to 12 are officially supported.";
}

View File

@@ -44,10 +44,10 @@ class HdCyclesVolumeLoader : public VDBImageLoader {
}
}
catch (const openvdb::IoError &e) {
LOG_WARNING << "Error loading OpenVDB file: " << e.what();
LOG_ERROR << "Error loading OpenVDB file: " << e.what();
}
catch (...) {
LOG_WARNING << "Error loading OpenVDB file: Unknown error";
LOG_ERROR << "Error loading OpenVDB file: Unknown error";
}
}
};

View File

@@ -46,7 +46,7 @@ static void check_invalidate_caches()
config = OCIO::GetCurrentConfig();
}
catch (const OCIO::Exception &exception) {
LOG_WARNING << "OCIO config error: " << exception.what();
LOG_ERROR << "OCIO config error: " << exception.what();
return;
}
@@ -80,7 +80,7 @@ ColorSpaceProcessor *ColorSpaceManager::get_processor(ustring colorspace)
config = OCIO::GetCurrentConfig();
}
catch (const OCIO::Exception &exception) {
LOG_WARNING << "OCIO config error: " << exception.what();
LOG_ERROR << "OCIO config error: " << exception.what();
return nullptr;
}
@@ -128,7 +128,7 @@ bool ColorSpaceManager::colorspace_is_data(ustring colorspace)
config = OCIO::GetCurrentConfig();
}
catch (const OCIO::Exception &exception) {
LOG_WARNING << "OCIO config error: " << exception.what();
LOG_ERROR << "OCIO config error: " << exception.what();
return false;
}
@@ -208,7 +208,7 @@ ustring ColorSpaceManager::detect_known_colorspace(ustring colorspace,
config = OCIO::GetCurrentConfig();
}
catch (const OCIO::Exception &exception) {
LOG_WARNING << "OCIO config error: " << exception.what();
LOG_ERROR << "OCIO config error: " << exception.what();
return u_colorspace_raw;
}

View File

@@ -19,23 +19,28 @@ bool OIIOImageLoader::load_metadata(const ImageDeviceFeatures & /*features*/,
ImageMetaData &metadata)
{
/* Perform preliminary checks, with meaningful logging. */
if (filepath.empty()) {
return false;
}
if (!path_exists(filepath.string())) {
LOG_WARNING << "File '" << filepath.string() << "' does not exist.";
LOG_ERROR << "Image file '" << filepath.string() << "' does not exist.";
return false;
}
if (path_is_directory(filepath.string())) {
LOG_WARNING << "File '" << filepath.string() << "' is a directory, cannot use as image.";
LOG_ERROR << "Image file '" << filepath.string() << "' is a directory, cannot use as image.";
return false;
}
unique_ptr<ImageInput> in(ImageInput::create(filepath.string()));
if (!in) {
LOG_ERROR << "Image file '" << filepath.string() << "' failed to load.";
return false;
}
ImageSpec spec;
if (!in->open(filepath.string(), spec)) {
LOG_ERROR << "Image file '" << filepath.string() << "' failed to open.";
return false;
}

View File

@@ -272,10 +272,10 @@ struct ToNanoOp {
# endif
}
catch (const std::exception &e) {
LOG_WARNING << "Error converting OpenVDB to NanoVDB grid: " << e.what();
LOG_ERROR << "Error converting OpenVDB to NanoVDB grid: " << e.what();
}
catch (...) {
LOG_WARNING << "Error converting OpenVDB to NanoVDB grid: Unknown error";
LOG_ERROR << "Error converting OpenVDB to NanoVDB grid: Unknown error";
}
return true;
}