Projekt

Allgemein

Profil

Logging » Historie » Version 3

Maximilian Seesslen, 18.02.2026 17:27

1 1 Maximilian Seesslen
h1. Logging
2
3
lCriticalE( Tdt::ELog::batteryLow, LDS("BTLW", "Battery Low") );
4
5
Type is missing, no data
6
7
lCriticalE( Tdt::ELog::batteryLow, LDS("BTLW %d", "Battery Low: %d"), batteryVoltage );
8
lCriticalE2( Tdt::ELog::batteryLow, Tdt::EUnit::milliVolt, LDS("BTLW %d", "Battery Low: %d"), batteryVoltage );
9
lCriticalBatteryLow( batteryVoltage );
10
11
#define EV_STR                      "#1-%X:"
12
#define EV2_STR                     "#2-%X-%X:"
13
#define EV( code1, format)          EV_STR format, code1
14
#define EV2( code1, code2, format)  EV2_STR format, code1, code2
15
16
#define lCriticalE(code, msg, ... ) lLogChooser(ELogCategory::Critical, EV(code, msg), ##__VA_ARGS__ )
17
#define lCriticalE2(code1, code2, msg, ... ) lLogChooser(ELogCategory::Criticalcode, EV2(code1, code2, msg), ##__VA_ARGS__ )
18 2 Maximilian Seesslen
19
Is it worth it? Low level functions will not use event codes anyways and application functions called in main loop can just send CAN messages.
20
TDT should just provide functions.
21 3 Maximilian Seesslen
Biwak is using it in CAN transmit. Thats nice to keep track of problems. Showing errors on 7segment-displays would be possible. Keep critical problems traceable.
22 2 Maximilian Seesslen
Seeing undervoltage problems afterwards would also be nice.
23 1 Maximilian Seesslen
Call log code manually?
24 3 Maximilian Seesslen
25
lCode( ELogCategory::Critical, Tdt::ELog::batteryLow, batteryVoltage );