[Bf-blender-cvs] [2c1bffa286b] master: Cleanup: add verbose logging category names instead of numbers

Brecht Van Lommel noreply at git.blender.org
Fri Jun 17 14:09:13 CEST 2022


Commit: 2c1bffa286b9551c0533081cb16f497058974b03
Author: Brecht Van Lommel
Date:   Thu Jun 16 19:39:13 2022 +0200
Branches: master
https://developer.blender.org/rB2c1bffa286b9551c0533081cb16f497058974b03

Cleanup: add verbose logging category names instead of numbers

And use them more consistently than before.

===================================================================

M	intern/cycles/blender/camera.cpp
M	intern/cycles/blender/curves.cpp
M	intern/cycles/blender/display_driver.cpp
M	intern/cycles/blender/mesh.cpp
M	intern/cycles/blender/object.cpp
M	intern/cycles/blender/session.cpp
M	intern/cycles/blender/sync.cpp
M	intern/cycles/bvh/build.cpp
M	intern/cycles/bvh/embree.cpp
M	intern/cycles/device/cpu/device_impl.cpp
M	intern/cycles/device/cuda/device.cpp
M	intern/cycles/device/cuda/device_impl.cpp
M	intern/cycles/device/cuda/queue.cpp
M	intern/cycles/device/device.cpp
M	intern/cycles/device/hip/device.cpp
M	intern/cycles/device/hip/device_impl.cpp
M	intern/cycles/device/hip/queue.cpp
M	intern/cycles/device/metal/device_impl.mm
M	intern/cycles/device/metal/queue.mm
M	intern/cycles/device/optix/device.cpp
M	intern/cycles/device/optix/device_impl.cpp
M	intern/cycles/device/queue.cpp
M	intern/cycles/integrator/denoiser.cpp
M	intern/cycles/integrator/denoiser_device.cpp
M	intern/cycles/integrator/denoiser_oidn.cpp
M	intern/cycles/integrator/path_trace.cpp
M	intern/cycles/integrator/path_trace_work_gpu.cpp
M	intern/cycles/integrator/render_scheduler.cpp
M	intern/cycles/integrator/shader_eval.cpp
M	intern/cycles/integrator/work_tile_scheduler.cpp
M	intern/cycles/kernel/osl/services.cpp
M	intern/cycles/scene/alembic.cpp
M	intern/cycles/scene/camera.cpp
M	intern/cycles/scene/colorspace.cpp
M	intern/cycles/scene/constant_fold.cpp
M	intern/cycles/scene/film.cpp
M	intern/cycles/scene/geometry.cpp
M	intern/cycles/scene/image.cpp
M	intern/cycles/scene/image_oiio.cpp
M	intern/cycles/scene/image_vdb.cpp
M	intern/cycles/scene/integrator.cpp
M	intern/cycles/scene/light.cpp
M	intern/cycles/scene/object.cpp
M	intern/cycles/scene/osl.cpp
M	intern/cycles/scene/particles.cpp
M	intern/cycles/scene/scene.cpp
M	intern/cycles/scene/shader_graph.cpp
M	intern/cycles/scene/shader_nodes.cpp
M	intern/cycles/scene/svm.cpp
M	intern/cycles/scene/tables.cpp
M	intern/cycles/scene/volume.cpp
M	intern/cycles/session/session.cpp
M	intern/cycles/session/tile.cpp
M	intern/cycles/test/render_graph_finalize_test.cpp
M	intern/cycles/util/debug.cpp
M	intern/cycles/util/log.h
M	intern/cycles/util/task.cpp

===================================================================

diff --git a/intern/cycles/blender/camera.cpp b/intern/cycles/blender/camera.cpp
index 402fd7c4ec6..2ab5f02a337 100644
--- a/intern/cycles/blender/camera.cpp
+++ b/intern/cycles/blender/camera.cpp
@@ -643,7 +643,7 @@ void BlenderSync::sync_camera_motion(
     /* TODO(sergey): De-duplicate calculation with camera sync. */
     float fov = 2.0f * atanf((0.5f * sensor_size) / bcam.lens / aspectratio);
     if (fov != cam->get_fov()) {
-      VLOG(3) << "Camera " << b_ob.name() << " FOV change detected.";
+      VLOG_WORK << "Camera " << b_ob.name() << " FOV change detected.";
       if (motion_time == 0.0f) {
         cam->set_fov(fov);
       }
diff --git a/intern/cycles/blender/curves.cpp b/intern/cycles/blender/curves.cpp
index 4e9f4f62087..b01cb85711a 100644
--- a/intern/cycles/blender/curves.cpp
+++ b/intern/cycles/blender/curves.cpp
@@ -341,7 +341,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)) {
-    VLOG(1) << "Hair memory allocation failed, clearing data.";
+    VLOG_WARNING << "Hair memory allocation failed, clearing data.";
     hair->clear(true);
   }
 }
@@ -397,7 +397,7 @@ static void export_hair_motion_validate_attribute(Hair *hair,
   if (num_motion_keys != num_keys || !have_motion) {
     /* No motion or hair "topology" changed, remove attributes again. */
     if (num_motion_keys != num_keys) {
-      VLOG(1) << "Hair topology changed, removing motion attribute.";
+      VLOG_WORK << "Hair topology changed, removing motion attribute.";
     }
     hair->attributes.remove(ATTR_STD_MOTION_VERTEX_POSITION);
   }
diff --git a/intern/cycles/blender/display_driver.cpp b/intern/cycles/blender/display_driver.cpp
index ee67073a9a4..a1bc064be68 100644
--- a/intern/cycles/blender/display_driver.cpp
+++ b/intern/cycles/blender/display_driver.cpp
@@ -982,10 +982,8 @@ void BlenderDisplayDriver::draw(const Params &params)
   gl_render_sync_ = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
   glFlush();
 
-  if (VLOG_IS_ON(5)) {
-    VLOG(5) << "Number of textures: " << GLTexture::num_used;
-    VLOG(5) << "Number of PBOs: " << GLPixelBufferObject::num_used;
-  }
+  VLOG_DEVICE_STATS << "Display driver number of textures: " << GLTexture::num_used;
+  VLOG_DEVICE_STATS << "Display driver number of PBOs: " << GLPixelBufferObject::num_used;
 
   if (use_gl_context_) {
     gl_context_mutex_.unlock();
diff --git a/intern/cycles/blender/mesh.cpp b/intern/cycles/blender/mesh.cpp
index e2db52cc5c1..63913b7cd7f 100644
--- a/intern/cycles/blender/mesh.cpp
+++ b/intern/cycles/blender/mesh.cpp
@@ -1212,17 +1212,17 @@ void BlenderSync::sync_mesh_motion(BL::Depsgraph b_depsgraph,
           memcmp(mP, &mesh->get_verts()[0], sizeof(float3) * numverts) == 0) {
         /* no motion, remove attributes again */
         if (b_mesh.vertices.length() != numverts) {
-          VLOG(1) << "Topology differs, disabling motion blur for object " << ob_name;
+          VLOG_WARNING << "Topology differs, disabling motion blur for object " << ob_name;
         }
         else {
-          VLOG(1) << "No actual deformation motion for object " << ob_name;
+          VLOG_DEBUG << "No actual deformation motion for object " << ob_name;
         }
         mesh->attributes.remove(ATTR_STD_MOTION_VERTEX_POSITION);
         if (attr_mN)
           mesh->attributes.remove(ATTR_STD_MOTION_VERTEX_NORMAL);
       }
       else if (motion_step > 0) {
-        VLOG(1) << "Filling deformation motion for object " << ob_name;
+        VLOG_DEBUG << "Filling deformation motion for object " << ob_name;
         /* motion, fill up previous steps that we might have skipped because
          * they had no motion, but we need them anyway now */
         float3 *P = &mesh->get_verts()[0];
@@ -1236,8 +1236,8 @@ void BlenderSync::sync_mesh_motion(BL::Depsgraph b_depsgraph,
     }
     else {
       if (b_mesh.vertices.length() != numverts) {
-        VLOG(1) << "Topology differs, discarding motion blur for object " << ob_name << " at time "
-                << motion_step;
+        VLOG_WARNING << "Topology differs, discarding motion blur for object " << ob_name
+                     << " at time " << motion_step;
         memcpy(mP, &mesh->get_verts()[0], sizeof(float3) * numverts);
         if (mN != NULL) {
           memcpy(mN, attr_N->data_float3(), sizeof(float3) * numverts);
diff --git a/intern/cycles/blender/object.cpp b/intern/cycles/blender/object.cpp
index 9b08b564b25..ca1aa6329d9 100644
--- a/intern/cycles/blender/object.cpp
+++ b/intern/cycles/blender/object.cpp
@@ -762,7 +762,7 @@ void BlenderSync::sync_motion(BL::RenderSettings &b_render,
       continue;
     }
 
-    VLOG(1) << "Synchronizing motion for the relative time " << relative_time << ".";
+    VLOG_WORK << "Synchronizing motion for the relative time " << relative_time << ".";
 
     /* fixed shutter time to get previous and next frame for motion pass */
     float shuttertime = scene->motion_shutter_time();
diff --git a/intern/cycles/blender/session.cpp b/intern/cycles/blender/session.cpp
index 87f051ba50b..6d27b8e7d87 100644
--- a/intern/cycles/blender/session.cpp
+++ b/intern/cycles/blender/session.cpp
@@ -458,8 +458,8 @@ void BlenderSession::render(BL::Depsgraph &b_depsgraph_)
 
   double total_time, render_time;
   session->progress.get_time(total_time, render_time);
-  VLOG(1) << "Total render time: " << total_time;
-  VLOG(1) << "Render time (without synchronization): " << render_time;
+  VLOG_INFO << "Total render time: " << total_time;
+  VLOG_INFO << "Render time (without synchronization): " << render_time;
 }
 
 void BlenderSession::render_frame_finish()
diff --git a/intern/cycles/blender/sync.cpp b/intern/cycles/blender/sync.cpp
index 1028c940772..63e9e1e0e68 100644
--- a/intern/cycles/blender/sync.cpp
+++ b/intern/cycles/blender/sync.cpp
@@ -285,7 +285,7 @@ void BlenderSync::sync_data(BL::RenderSettings &b_render,
 
   free_data_after_sync(b_depsgraph);
 
-  VLOG(1) << "Total time spent synchronizing data: " << timer.get_time();
+  VLOG_INFO << "Total time spent synchronizing data: " << timer.get_time();
 
   has_updates_ = false;
 }
@@ -390,7 +390,7 @@ void BlenderSync::sync_integrator(BL::ViewLayer &b_view_layer, bool background)
   }
 
   if (scrambling_distance != 1.0f) {
-    VLOG(3) << "Using scrambling distance: " << scrambling_distance;
+    VLOG_INFO << "Using scrambling distance: " << scrambling_distance;
   }
   integrator->set_scrambling_distance(scrambling_distance);
 
diff --git a/intern/cycles/bvh/build.cpp b/intern/cycles/bvh/build.cpp
index 1df3517673e..cf03f05de60 100644
--- a/intern/cycles/bvh/build.cpp
+++ b/intern/cycles/bvh/build.cpp
@@ -529,7 +529,7 @@ BVHNode *BVHBuild::run()
     if (progress.get_cancel()) {
       rootnode->deleteSubtree();
       rootnode = NULL;
-      VLOG(1) << "BVH build cancelled.";
+      VLOG_WORK << "BVH build cancelled.";
     }
     else {
       /*rotate(rootnode, 4, 5);*/
@@ -537,26 +537,26 @@ BVHNode *BVHBuild::run()
       rootnode->update_time();
     }
     if (rootnode != NULL) {
-      VLOG(1) << "BVH build statistics:\n"
-              << "  Build time: " << time_dt() - build_start_time << "\n"
-              << "  Total number of nodes: "
-              << string_human_readable_number(rootnode->getSubtreeSize(BVH_STAT_NODE_COUNT))
-              << "\n"
-              << "  Number of inner nodes: "
-              << string_human_readable_number(rootnode->getSubtreeSize(BVH_STAT_INNER_COUNT))
-              << "\n"
-              << "  Number of leaf nodes: "
-              << string_human_readable_number(rootnode->getSubtreeSize(BVH_STAT_LEAF_COUNT))
-              << "\n"
-              << "  Number of unaligned nodes: "
-              << string_human_readable_number(rootnode->getSubtreeSize(BVH_STAT_UNALIGNED_COUNT))
-              << "\n"
-              << "  Allocation slop factor: "
-              << ((prim_type.capacity() != 0) ? (float)prim_type.size() / prim_type.capacity() :
-                                                1.0f)
-              << "\n"
-              << "  Maximum depth: "
-              << string_human_readable_number(rootnode->getSubtreeSize(BVH_STAT_DEPTH)) << "\n";
+      VLOG_WORK << "BVH build statistics:\n"
+                << "  Build time: " << time_dt() - build_start_time << "\n"
+                << "  Total number of nodes: "
+                << string_human_readable_number(rootnode->getSubtreeSize(BVH_STAT_NODE_COUNT))
+                << "\n"
+                << "  Number of inner nodes: "
+                << string_human_readable_number(rootnode->getSubtreeSize(BVH_STAT_INNER_COUNT))
+                << "\n"
+                << "  Number of leaf nodes: "
+                << string_human_readable_number(rootnode->getSubtreeSize(BVH_STAT_LEAF_COUNT))
+                << "\n"
+                << "  Number of unaligned nodes: "
+                << string_human_readable_number(rootnode->getSubtreeSize(BVH_STAT_UNALIGNED_COUNT))
+                << "\n"
+                << "  Allocation slop factor: "
+                << ((prim_type.capacity() != 0) ? (float)prim_type.size() / prim_type.capacity() :
+                                                  1.0f)
+                << "\n"
+                << "  Maximum depth: "
+                << string_human_readable_number(rootnode->getSubtreeSize(BVH_STAT_DEPTH)) << "\n";
     }
   }
 
diff --git a/intern/cycles/bvh/embree.cpp b/intern/cycles/bvh/embree.cpp
index 0fc71f49ce3..ea7480bd193 100644
--- a/intern/cycles/bvh/embree.cpp
+++ b/intern/cycles/bvh/embree.cpp
@@ -332,7 +332,7 @@ static bool rtc_memory_monitor_func(void *userPtr, const ssize_t bytes, const bo
 
 static void rtc_error_func(void *, enum RTCError, const char *str)
 {
-  VLOG(1) << str;
+  VLOG_WARNING << str;
 }
 
 static double progress_start_time = 0.0;
@@ -521,8 +521,8 @@ void BVHEmbree::add_triangles(const Object *ob, const Mesh *mesh, int i)
       geom_id, RTC_BUFFER_TYPE_INDEX, 0, RTC_FORMAT_UINT3, sizeof(int) * 3, num_triangles);
   assert(rtc_indices);
   if (!rtc_indices) {
-    VLOG(1) << "Embree could not create new geometry buffer for mes

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list