Provides the means to log debug text to various log areas and at various severity levels and send it to a MODSERIAL serial port object for output.
Revision 1:e1be56fa979a, committed 2017-06-10
- Comitter:
- paul_harris77
- Date:
- Sat Jun 10 23:07:20 2017 +0000
- Parent:
- 0:23f7bb983ae0
- Child:
- 2:f1b41864f865
- Commit message:
- Added new areas.
Changed in this revision
| cLogger.cpp | Show annotated file Show diff for this revision Revisions of this file |
| logger_defs.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/cLogger.cpp Fri Jun 02 16:54:30 2017 +0000
+++ b/cLogger.cpp Sat Jun 10 23:07:20 2017 +0000
@@ -15,6 +15,17 @@
//Register the LOG area as the first log area for use by the cLogger itself
registerLogArea(LOGGER, ERROR, "LOGGER>> ");
+
+ //Register required log areas here and set default log levels:
+ registerLogArea(MAIN, NORMAL, "MAIN>>");
+ registerLogArea(MAIN_CONTROL, NORMAL, "MAIN_CONTROL>>");
+ registerLogArea(LIDAR_IF, SUPPRESSED, "LIDAR_IF>>");
+ registerLogArea(LIDAR_CONTROL, SUPPRESSED, "LIDAR_CONTROL>>");
+ registerLogArea(MOTOR_CONTROL, SUPPRESSED, "MOTOR_CONTROL>>");
+ registerLogArea(ENCODER, SUPPRESSED, "ENCODER>>");
+ registerLogArea(EVENT, DETAILED, "EVENT>>");
+ registerLogArea(OBSERVER, DETAILED, "OBSERVER>>");
+
}
//***********Begin public member functions************
@@ -187,3 +198,5 @@
//***********End private member functions************
+
+
--- a/logger_defs.h Fri Jun 02 16:54:30 2017 +0000
+++ b/logger_defs.h Sat Jun 10 23:07:20 2017 +0000
@@ -28,20 +28,26 @@
enum eLogArea{
LOGGER = 0, //Log area for the logger itself. Required as an absolute minimum.
MAIN = 1,
- LIDAR_IF = 2,
- LIDAR = 3,
- MOTOR_CONTROL = 4,
- ENCODER = 5
+ MAIN_CONTROL = 2,
+ LIDAR_IF = 3,
+ LIDAR_CONTROL = 4,
+ MOTOR_CONTROL = 5,
+ ENCODER = 6,
+ EVENT = 7,
+ OBSERVER = 8
};
//Array of char pointers with name of log area enums for printing out (must match enums above)
static const char* sLogArea[] = {
"LOGGER",
"MAIN",
+ "MAIN_CONTROL",
"LIDAR_IF",
- "LIDAR",
+ "LIDAR_CONTROL",
"MOTOR_CONTROL",
- "ENCODER"
+ "ENCODER",
+ "EVENT",
+ "OBSERVER"
};
#endif
\ No newline at end of file