Action Item #510
Add function[file:line] to prefix in pncLogger()
|Status:||Closed||Start date:||15 Mar 2016|
|Severity:||01 - Critical|
This can be done in libpibox by
- changing pncLogger() to _pncLogger()
- Adding const char*, const char *, int to the front of the args to _pncLogger()
- Adding a macro pncLogger() that wraps _pncLogger()
- Placing the gcc preprocessor defines FUNCTION, FILE and LINE in for the new args to _pncLogger()
Then apps just need to be recompiled with the updated library to use this.
RM #510: Add function, file and line to logs automatically by wrapping pncLogger() with a macro.
#1 Updated by Hammel almost 2 years ago
- Status changed from New to In Progress
- % Done changed from 0 to 10
This will be a little bit of work. First, I need to change the pncLogger() call to a macro and the function to _pncLogger(), being sure to export that from the library. I need to build and test this with the daemons and apps on the dev host. I should also format the log so function is fixed in size and so is file, so the logs line up nicely. I should add a timestamp option to the library that can be set with pncLoggerInit() or with a new API function. It might be nice to have pncLoggerInit() be an overloaded macro.
After fixing libpibox I may need rebuild libpiboxnet since multiple apps depend on it.
Then I need to rebuild the apps to make sure they all work. Only those that depend on libpibox are a concern (re: non-of the metabuilds, only my PiBox daemons and apps).
I need to commit the libs first, then the apps. The apps shouldn't need any changes but will get them if they use FUNCTION, FILE, or LINE in any existing calls to pncLogger().
#2 Updated by Hammel almost 2 years ago
- % Done changed from 10 to 70
Recompiles was all that was required for libpnc and the apps. They all seem to be perfectly happy with that. I need to rebuild my local rpi tree with an updated libpibox so cross compiles will include that.I want to look at adding config options to logging that allows:
- restricting function/file/line to a reduced and uniform length.
After that I can close this issue.