Aktionen
Logging » Historie » Revision 2
« Zurück |
Revision 2/6
(diff)
| Weiter »
Maximilian Seesslen, 21.12.2022 13:29
Logging¶
There is no clean logging concept at the moment.
- Work within ISRs.
- Only short messages, e.g. 20 chars.
- Heart-beat LED might be involved
- CAN might be involved to transmit diagnose
- Debug can be disabled even for Debug-builds; BIWAK_LOG_DEBUG has to be defined to show bDebug
Heartbeat-Class¶
An LED can indicate problems.
- good (double)
- crytical error (fast blink)
- fatal error (slow blink)
- temporary error/ trouble (fast blink - off 1Hz) (goes away)
Usecases¶
- invalid eeprom causes "critical"-state
- Not being able to sen CAN messages causes "trouble"
- fatal: the application can not run for some reason but the led should work; e.g. a reception buffer is full
- exception: Don't even try to run any more. e.g. memory error.
Examples¶
add_definitions( BIWAK_LOG_HEARTBEAT )
add_definitions( BIWAK_LOG_CAN )
add_definitions( BIWAK_LOG_DEBUG )
#define bDebug(a,...) debug(a, __VA_ARGS__)
#include <biwak/log.hpp>
main()
{
bDebug(); // Just print some text
bCritical();
bTrouble(); //
bFatal();
bException("Static text");
}
Von Maximilian Seesslen vor etwa 2 Jahren aktualisiert · 2 Revisionen