Back

MessageHandlerComponent

sofa::component::sceneutility::MessageHandlerComponent
BaseObject
Doc (from source)

This object controls the way Sofa print's A sofa component to add a MessageHandler to the main logger

Abstract (AI generated)

The `MessageHandlerComponent` manages logging behavior in SOFA simulations by controlling how informational, warning, error, and fatal messages are handled.

Metadata
module
Sofa.Component.SceneUtility
namespace
sofa::component::sceneutility
include
sofa/component/sceneutility/MessageHandlerComponent.h
inherits
  • BaseObject
description

The MessageHandlerComponent in the SOFA framework is designed to control how Sofa logs its informational, warning, error, and fatal messages. It does not contribute to any governing equations or operators such as mass matrix $ M $, stiffness matrix $ K $, internal force $ f_{int} $, residual $ R $, etc., nor does it involve constitutive or kinematic laws, constraints, mappings, or numerical methods used in the FEM simulation pipeline. Instead, its primary role is to manage logging behavior within SOFA simulations.

The component allows users to specify different types of message handlers through an attribute (e.g., 'sofa', 'clang', 'rich', or 'silent') in the configuration. The MessageHandlerComponent parses these attributes and sets up the appropriate handler for logging purposes. Specifically, it interacts with SOFA's logging system by adding or clearing handlers based on user-defined settings.

The parse method of MessageHandlerComponent interprets the given description to assign values to its fields and set up message handlers accordingly. If no valid handler type is specified, the default behavior uses the 'sofa' style handler. The component also includes a FileMessageHandlerComponent, which extends the functionality by allowing logging messages to be saved into a file.

In summary, while the MessageHandlerComponent plays an essential role in controlling the logging output within SOFA simulations, it does not involve any mathematical or physical content related to FEM simulation. Its primary function is to manage and customize how Sofa logs its various informational levels.

Methods
void parse (core::objectmodel::BaseObjectDescription * arg) virtual
bool isValid ()
{
  "name": "MessageHandlerComponent",
  "namespace": "sofa::component::sceneutility",
  "module": "Sofa.Component.SceneUtility",
  "include": "sofa/component/sceneutility/MessageHandlerComponent.h",
  "doc": "This object controls the way Sofa print's\n\nA sofa component to add a MessageHandler to the main logger",
  "inherits": [
    "BaseObject"
  ],
  "templates": [],
  "data_fields": [],
  "links": [],
  "methods": [
    {
      "name": "parse",
      "return_type": "void",
      "params": [
        {
          "name": "arg",
          "type": "core::objectmodel::BaseObjectDescription *"
        }
      ],
      "is_virtual": true,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    },
    {
      "name": "isValid",
      "return_type": "bool",
      "params": [],
      "is_virtual": false,
      "is_pure_virtual": false,
      "is_static": false,
      "access": "public"
    }
  ],
  "description": "The `MessageHandlerComponent` in the SOFA framework is designed to control how Sofa logs its informational, warning, error, and fatal messages. This component allows users to specify different types of message handlers (e.g., 'sofa', 'clang', 'rich', or 'silent') through an attribute in the configuration. The `MessageHandlerComponent` inherits from `BaseObject`, which means it integrates seamlessly with SOFA's object model for scene management.\n\nIt interacts with other components by using the `parse` method to interpret configuration settings and set up message handlers accordingly. The component can be configured via XML attributes, where a 'handler' attribute determines the type of message handler to use. If no valid handler is specified, it defaults to the Sofa style handler.\n\nFor practical usage, users should ensure that the `MessageHandlerComponent` is correctly initialized with the desired handler type and placed in the scene graph for effective logging control.",
  "maths": "The `MessageHandlerComponent` in the SOFA framework is designed to control how Sofa logs its informational, warning, error, and fatal messages. It does not contribute to any governing equations or operators such as mass matrix \\( M \\), stiffness matrix \\( K \\), internal force \\( f_{int} \\), residual \\( R \\), etc., nor does it involve constitutive or kinematic laws, constraints, mappings, or numerical methods used in the FEM simulation pipeline. Instead, its primary role is to manage logging behavior within SOFA simulations.\n\nThe component allows users to specify different types of message handlers through an attribute (e.g., 'sofa', 'clang', 'rich', or 'silent') in the configuration. The `MessageHandlerComponent` parses these attributes and sets up the appropriate handler for logging purposes. Specifically, it interacts with SOFA's logging system by adding or clearing handlers based on user-defined settings.\n\nThe `parse` method of `MessageHandlerComponent` interprets the given description to assign values to its fields and set up message handlers accordingly. If no valid handler type is specified, the default behavior uses the 'sofa' style handler. The component also includes a `FileMessageHandlerComponent`, which extends the functionality by allowing logging messages to be saved into a file.\n\nIn summary, while the `MessageHandlerComponent` plays an essential role in controlling the logging output within SOFA simulations, it does not involve any mathematical or physical content related to FEM simulation. Its primary function is to manage and customize how Sofa logs its various informational levels.",
  "abstract": "The `MessageHandlerComponent` manages logging behavior in SOFA simulations by controlling how informational, warning, error, and fatal messages are handled.",
  "sheet": "# MessageHandlerComponent\n\n## Overview\n\nThe `MessageHandlerComponent`, part of the `sofa::component::sceneutility` namespace, is designed to control the way Sofa logs its various message levels (informational, warning, error, fatal). It integrates with SOFA's logging system by adding or clearing handlers based on user-defined settings. The component inherits from `BaseObject`, ensuring seamless integration into the scene graph.\n\n## Practical Notes\n\nUsers should ensure that the `MessageHandlerComponent` is correctly initialized with the desired handler type (e.g., 'sofa', 'clang', 'rich', or 'silent') and placed in the scene graph for effective logging control. If no valid handler is specified, it defaults to the 'sofa' style handler."
}