Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging Enhancements #155

Open
amcgee opened this issue Jan 8, 2015 · 1 comment
Open

Logging Enhancements #155

amcgee opened this issue Jan 8, 2015 · 1 comment

Comments

@amcgee
Copy link
Member

amcgee commented Jan 8, 2015

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.
@amcgee
Copy link
Member Author

amcgee commented Jan 8, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant