DefaultStyleMessageFormatter
The `DefaultStyleMessageFormatter` is a class in the SOFA framework, specifically within the `sofa::helper::logging` namespace. It inherits from `MessageFormatter` and provides a simple style for formatting log messages with basic coloring and prefixing based on message type (e.g., ERROR). The formatted output includes details like the message sender's component information and the actual message content. This class is designed to be used in logging to provide consistent and readable output. It interacts with other SOFA components through the `MessageFormatter` API, which it implements. Specifically, the method `formatMessage` takes a `const Message &` and an `std::ostream &`, formatting the message accordingly. The class also provides a static `getInstance` method to retrieve a singleton instance of itself. Practical usage involves calling `formatMessage` on an instance of this formatter to log messages with the default style. No specific data fields are used internally.
- abstract
- The `DefaultStyleMessageFormatter` class in the SOFA framework formats log messages with a simple style, including basic coloring and prefixing based on message type.
- sheet
- # DefaultStyleMessageFormatter ## Overview The `DefaultStyleMessageFormatter` is a logging utility that provides a simple style for formatting log messages. It inherits from `MessageFormatter` and formats messages to include details like the message sender's component information, message type (e.g., ERROR), and the actual message content. The class offers a static method `getInstance` to retrieve a singleton instance of itself and a public method `formatMessage` to format log messages according to the predefined style.
- description
- The `DefaultStyleMessageFormatter` is a class in the SOFA framework, specifically within the `sofa::helper::logging` namespace. It inherits from `MessageFormatter` and provides a simple style for formatting log messages with basic coloring and prefixing based on message type (e.g., ERROR). The formatted output includes details like the message sender's component information and the actual message content. This class is designed to be used in logging to provide consistent and readable output. It interacts with other SOFA components through the `MessageFormatter` API, which it implements. Specifically, the method `formatMessage` takes a `const Message &` and an `std::ostream &`, formatting the message accordingly. The class also provides a static `getInstance` method to retrieve a singleton instance of itself. Practical usage involves calling `formatMessage` on an instance of this formatter to log messages with the default style. No specific data fields are used internally.
- maths
- The `DefaultStyleMessageFormatter` class in the SOFA framework does not have any mathematical or physical content related to FEM (Finite Element Method) or other simulation techniques. It is purely a utility for formatting log messages and providing consistent output. ### Governing Equations or Operators: - **None**: The component does not contribute to any governing equations, matrices, forces, residuals, etc., in the context of FEM or simulations. ### Constitutive or Kinematic Laws Involved: - **None**: There are no constitutive models, strain measures, stress tensors, hyperelastic potentials, damping models, constraint Jacobians, etc. involved in this component. ### Role in the Global FEM Pipeline: - **Logging Utility**: The `DefaultStyleMessageFormatter` is not part of the global FEM pipeline but rather a utility for logging purposes. It formats log messages to provide consistent and readable output with basic coloring and prefixing based on message type (e.g., ERROR). ### Numerical Methods or Discretization Choices: - **None**: The component does not involve any numerical methods, discretization choices, time integration schemes, solvers, or other FEM-related techniques. ### Variational / Lagrangian Mechanics Framework: - **None**: This class is not related to the variational or Lagrangian mechanics framework. It solely serves as a utility for logging messages in a standardized format.
{
"name": "DefaultStyleMessageFormatter",
"main": {
"name": "DefaultStyleMessageFormatter",
"namespace": "sofa::helper::logging",
"module": "Sofa.framework.Helper",
"include": "sofa/helper/logging/DefaultStyleMessageFormatter.h",
"doc": "Format the message using a very simple sofa style. For more advanced formatting style\nhave a look at RichStyleMessageFormatter.\nExample:\n [ERROR] ClassName(instanceName): this is a message printed somewhere.",
"inherits": [
"MessageFormatter"
],
"templates": [],
"data_fields": [],
"links": [],
"methods": [
{
"name": "getInstance",
"return_type": "MessageFormatter &",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": true,
"access": "public"
},
{
"name": "formatMessage",
"return_type": "void",
"params": [
{
"name": "m",
"type": "const Message &"
},
{
"name": "out",
"type": "int &"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
}
]
},
"desc": {
"description": "The `DefaultStyleMessageFormatter` is a class in the SOFA framework, specifically within the `sofa::helper::logging` namespace. It inherits from `MessageFormatter` and provides a simple style for formatting log messages with basic coloring and prefixing based on message type (e.g., ERROR). The formatted output includes details like the message sender's component information and the actual message content. This class is designed to be used in logging to provide consistent and readable output.\n\nIt interacts with other SOFA components through the `MessageFormatter` API, which it implements. Specifically, the method `formatMessage` takes a `const Message &` and an `std::ostream &`, formatting the message accordingly. The class also provides a static `getInstance` method to retrieve a singleton instance of itself.\n\nPractical usage involves calling `formatMessage` on an instance of this formatter to log messages with the default style. No specific data fields are used internally."
},
"maths": {
"maths": "The `DefaultStyleMessageFormatter` class in the SOFA framework does not have any mathematical or physical content related to FEM (Finite Element Method) or other simulation techniques. It is purely a utility for formatting log messages and providing consistent output.\n\n### Governing Equations or Operators:\n- **None**: The component does not contribute to any governing equations, matrices, forces, residuals, etc., in the context of FEM or simulations.\n\n### Constitutive or Kinematic Laws Involved:\n- **None**: There are no constitutive models, strain measures, stress tensors, hyperelastic potentials, damping models, constraint Jacobians, etc. involved in this component.\n\n### Role in the Global FEM Pipeline:\n- **Logging Utility**: The `DefaultStyleMessageFormatter` is not part of the global FEM pipeline but rather a utility for logging purposes. It formats log messages to provide consistent and readable output with basic coloring and prefixing based on message type (e.g., ERROR).\n\n### Numerical Methods or Discretization Choices:\n- **None**: The component does not involve any numerical methods, discretization choices, time integration schemes, solvers, or other FEM-related techniques.\n\n### Variational / Lagrangian Mechanics Framework:\n- **None**: This class is not related to the variational or Lagrangian mechanics framework. It solely serves as a utility for logging messages in a standardized format.\n"
},
"summary": {
"abstract": "The `DefaultStyleMessageFormatter` class in the SOFA framework formats log messages with a simple style, including basic coloring and prefixing based on message type.",
"sheet": "\n# DefaultStyleMessageFormatter\n\n## Overview\n\nThe `DefaultStyleMessageFormatter` is a logging utility that provides a simple style for formatting log messages. It inherits from `MessageFormatter` and formats messages to include details like the message sender's component information, message type (e.g., ERROR), and the actual message content. The class offers a static method `getInstance` to retrieve a singleton instance of itself and a public method `formatMessage` to format log messages according to the predefined style.\n"
}
}