You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here are some possible extensions to the awesome typed log message feature @timburke wrote:
It doesn't seem like it would be too hard to store the hex-to-text mappings in program memory. So, for instance, in addition to #define kLogMessage <hexval> the build process could generate static const char* log_LogMessage = "The actual log message" (possibly in a primitive structure which allows it to be looked up by hexval). This would remove the requirement on having the relevant map file when parsing the log, since the device itself could provide the messages.
Python type declarations could likely be parsed directly from C types.
A pre-processing step could auto-generate the log message identifiers from text logs in the code, removing the need for an external name-log mapping file. I.E. LOG_DEBUG( "This is a test" ) could be replaced with LOG_DEBUG( kLog1234 ) before compilation, and then kLog1234 could be associated with the message and relevant hash and the log map file could be auto-generated. This would probably also need to be extended to declare the typed parameters as well.
The text was updated successfully, but these errors were encountered:
The text could alternatively be stored in Flash, which would allow mappings and log entries to persist across firmware versions, but this requires runtime initialization and de-duplication of the values when MoMo starts up.
Here are some possible extensions to the awesome typed log message feature @timburke wrote:
#define kLogMessage <hexval>
the build process could generatestatic const char* log_LogMessage = "The actual log message"
(possibly in a primitive structure which allows it to be looked up by hexval). This would remove the requirement on having the relevant map file when parsing the log, since the device itself could provide the messages.LOG_DEBUG( "This is a test" )
could be replaced withLOG_DEBUG( kLog1234 )
before compilation, and then kLog1234 could be associated with the message and relevant hash and the log map file could be auto-generated. This would probably also need to be extended to declare the typed parameters as well.The text was updated successfully, but these errors were encountered: