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.

logger_defs.h

Committer:
paul_harris77
Date:
2017-06-10
Revision:
1:e1be56fa979a
Parent:
0:23f7bb983ae0
Child:
2:f1b41864f865

File content as of revision 1:e1be56fa979a:

//*********************************************************************************************************************
//   LOGGER DEFINITIONS - HEADER FILE
//   PAUL HARRIS, OCTOBER 2016
// *********************************************************************************************************************

#ifndef LOGGER_DEFS_H
#define LOGGER_DEFS_H

enum eLogLevel{
    SUPPRESSED  = 0,
    ERROR       = 1,
    WARNING     = 2,
    NORMAL      = 3,
    DETAILED    = 4,
    VERBOSE     = 5
};

//Array of char pointers with name of log level enums for printing out (must match enums above)
static const char* sLogLevel[] = {
    "SUPPRESSED",
    "ERROR",
    "WARNING",
    "NORMAL",
    "DETAILED",
    "VERBOSE"
};

enum eLogArea{
    LOGGER          = 0, //Log area for the logger itself.  Required as an absolute minimum.
    MAIN            = 1,
    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_CONTROL",
    "MOTOR_CONTROL",
    "ENCODER",
    "EVENT",
    "OBSERVER"
};

#endif