Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/intern/geometry_nodes_eval_log.cc
| Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | for (NodeWithExecutionTime &node_with_exec_time : local_logger.node_exec_times_) { | ||||
| node_with_exec_time.node); | node_with_exec_time.node); | ||||
| node_log.exec_time_ = node_with_exec_time.exec_time; | node_log.exec_time_ = node_with_exec_time.exec_time; | ||||
| } | } | ||||
| for (NodeWithDebugMessage &debug_message : local_logger.node_debug_messages_) { | for (NodeWithDebugMessage &debug_message : local_logger.node_debug_messages_) { | ||||
| NodeLog &node_log = this->lookup_or_add_node_log(log_by_tree_context, debug_message.node); | NodeLog &node_log = this->lookup_or_add_node_log(log_by_tree_context, debug_message.node); | ||||
| node_log.debug_messages_.append(debug_message.message); | node_log.debug_messages_.append(debug_message.message); | ||||
| } | } | ||||
| for (NodeWithUsedNamedAttribute &node_with_attribute_name : | |||||
| local_logger.used_named_attributes_) { | |||||
| NodeLog &node_log = this->lookup_or_add_node_log(log_by_tree_context, | |||||
| node_with_attribute_name.node); | |||||
| node_log.used_named_attributes_.append(std::move(node_with_attribute_name.attribute)); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| TreeLog &ModifierLog::lookup_or_add_tree_log(LogByTreeContext &log_by_tree_context, | TreeLog &ModifierLog::lookup_or_add_tree_log(LogByTreeContext &log_by_tree_context, | ||||
| const DTreeContext &tree_context) | const DTreeContext &tree_context) | ||||
| { | { | ||||
| TreeLog *tree_log = log_by_tree_context.lookup_default(&tree_context, nullptr); | TreeLog *tree_log = log_by_tree_context.lookup_default(&tree_context, nullptr); | ||||
| if (tree_log != nullptr) { | if (tree_log != nullptr) { | ||||
| ▲ Show 20 Lines • Show All 408 Lines • ▼ Show 20 Lines | void LocalGeoLogger::log_node_warning(DNode node, NodeWarningType type, std::string message) | ||||
| node_warnings_.append({node, {type, std::move(message)}}); | node_warnings_.append({node, {type, std::move(message)}}); | ||||
| } | } | ||||
| void LocalGeoLogger::log_execution_time(DNode node, std::chrono::microseconds exec_time) | void LocalGeoLogger::log_execution_time(DNode node, std::chrono::microseconds exec_time) | ||||
| { | { | ||||
| node_exec_times_.append({node, exec_time}); | node_exec_times_.append({node, exec_time}); | ||||
| } | } | ||||
| void LocalGeoLogger::log_used_named_attribute(DNode node, | |||||
| std::string attribute_name, | |||||
| NamedAttributeUsage usage) | |||||
| { | |||||
| used_named_attributes_.append({node, {std::move(attribute_name), usage}}); | |||||
HooglyBoogly: It might be better for this to return early if the name is empty, rather than doing it in the… | |||||
Done Inline ActionsHm, to me it seems like something that the caller is responsible for. If the log function is called, it should also log something. JacquesLucke: Hm, to me it seems like something that the caller is responsible for. If the `log` function is… | |||||
Not Done Inline ActionsThat's also fine with me. In that case I think the input and store nodes need the empty() check. HooglyBoogly: That's also fine with me. In that case I think the input and store nodes need the `empty()`… | |||||
| } | |||||
| void LocalGeoLogger::log_debug_message(DNode node, std::string message) | void LocalGeoLogger::log_debug_message(DNode node, std::string message) | ||||
| { | { | ||||
| node_debug_messages_.append({node, std::move(message)}); | node_debug_messages_.append({node, std::move(message)}); | ||||
| } | } | ||||
| } // namespace blender::nodes::geometry_nodes_eval_log | } // namespace blender::nodes::geometry_nodes_eval_log | ||||
It might be better for this to return early if the name is empty, rather than doing it in the callers.