-
- Downloads
Merge branch 'logging' into 'master'
Logging This adds a Logging "library" to the ECSS Services repo. This library allows logging messages with different severities, and allows the user of the services to choose which severity they want displayed. A comparison between [Google (glog)](https://github.com/google/glog), [spdlog](https://github.com/gabime/spdlog), [plog](https://github.com/SergiusTheBest/plog) and [Boost::Log](https://www.boost.org/doc/libs/1_63_0/libs/log/doc/html/index.html) was made, and we decided to go with a custom lite solution, also compatible with `etl::string`. The following log levels are supported, but they are up for discussion: |Level|Description| |---|---| | **trace** | Very detailed information, useful for tracking the individual steps of an operation.| | **debug** | General debugging information.| | **info** | Noteworthy or periodical events.| | **notice** | Uncommon but expected events.| | **warning** | Unexpected events that do not compromise the operability of a function.| | **error** | Unexpected failure of an operation.| | **emergency** | Unexpected failure that renders the entire system unusable.| | **disabled** | Use this log level to disable logging entirely. No message should be logged as disabled.| The library uses `#define`s that allow logging in this way: ```c++ LOG_ERROR << "Configuration not found"; LOG_INFO << "The camera took " << 15 << " pictures today"; LOG_DEBUG << "Ran function " << functionName << " with " << getId(functionName); ``` Closes #18. It is lite enough to be used [on a microcontroller](https://gitlab.com/acubesat/obc/mockup-4/commit/4aaa55bb72030cee6cf4eca7b082297cf60edf37). **See https://acubesat.gitlab.io/obc/ecss-services/docs/classLogger.html for more detailed documentation of the Logger functionality**. The following images show a sample log output on x86 and on an MCU via UART:  See merge request acubesat/obc/ecss-services!44
Showing
- CMakeLists.txt 3 additions, 1 deletionCMakeLists.txt
- ci/cppcheck-misra.sh 10 additions, 2 deletionsci/cppcheck-misra.sh
- ci/summarizer.py 1 addition, 1 deletionci/summarizer.py
- ci/vera.sh 2 additions, 1 deletionci/vera.sh
- inc/ECSS_Definitions.hpp 5 additions, 0 deletionsinc/ECSS_Definitions.hpp
- inc/Logger.hpp 224 additions, 0 deletionsinc/Logger.hpp
- inc/Service.hpp 0 additions, 3 deletionsinc/Service.hpp
- lib/etl 1 addition, 1 deletionlib/etl
- src/Logger.cpp 24 additions, 0 deletionssrc/Logger.cpp
- src/Platform/x86/ErrorHandler.cpp 5 additions, 5 deletionssrc/Platform/x86/ErrorHandler.cpp
- src/Platform/x86/Logger.cpp 68 additions, 0 deletionssrc/Platform/x86/Logger.cpp
- src/Platform/x86/Service.cpp 14 additions, 10 deletionssrc/Platform/x86/Service.cpp
- src/Platform/x86/main.cpp 4 additions, 0 deletionssrc/Platform/x86/main.cpp
- test/TestPlatform.cpp 5 additions, 0 deletionstest/TestPlatform.cpp
Loading
Please register or sign in to comment