#
aaa4fddb |
| 18-Mar-2021 |
Shawn McCarney <shawnmm@us.ibm.com> |
regulators: Create error_logging_utils
Create the error_logging_utils namespace for utility functions that make it easier to log errors. Create two initial functions within the namespace.
The firs
regulators: Create error_logging_utils
Create the error_logging_utils namespace for utility functions that make it easier to log errors. Create two initial functions within the namespace.
The first function logs an error based on an exception. The exception may have one or more nested inner exceptions. The function finds the highest priority exception and logs a corresponding error.
The second function provides the same basic behavior as the first, but it adds an ErrorHistory parameter. An error will only be logged if it was not previously logged. The ErrorHistory object is used to determine whether an error has been previously logged. This avoids logging duplicate errors if a regulator operation is occurring repeatedly, such as reading sensor values.
Signed-off-by: Shawn McCarney <shawnmm@us.ibm.com> Change-Id: If246cde9a0f60c5bba34ae4a0d68fb511c0024fc
show more ...
|