-
Notifications
You must be signed in to change notification settings - Fork 4
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
refactored #18
Merged
Merged
refactored #18
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
oops! I didn't mean to merge this quite yet, but we can walk back any objections that arise. I just need to test the release assets here before we merge nRF24/RF24#772 which includes an almost identical CMake implementation. Release assets will be key in users installing the RF24 libs without needing to build/install from source! maybe down the line we can host our own PPA repo... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've taken the journey toward cross-platform compatibility... Along the way I made the following changes.
Printf Parser changes
printf()
is used by all platforms%b
specifier to represent integers as binary\n
chars are automatically triggering a newline+header info (timestamp, log level, vendorId). However the escaping mechanism can be used (as in%\n
) to only output a newline (no new header info)\t
char can be replaced with a number of spaces ifRF24LOG_TAB_SIZE
macro is defined (with a number as in the number of spaces to use instead of\t
).
char). If precision is set to zero (done when parser encounters a.
char), then a zero value will not be printed. As of this writing, padding the whole number of a double/float value is not supported.Lib structure
I have restructured the lib for conceptual reasons.
ArduinoPrintLogger
which was renamed from RF24StreamLogHandler.NativePrintLogger
for pico SDK and any platform that hasprintf()
natively availableOStreamLogger
for using C++'sostream
based objects as the output streamRF24LogDualHandler
now lives in a handler_ext folder because any class that inherits from the RF24LogBaseHandler class but not from an abstract stream class is likely an extension to the base handler mechanismCMake integration
Docs on how to use the CMake build system are pending a stable/reliable solution.
some code changes
info()
,debug()
,error()
,warn()
) from earlier stages of developmentrf24Logging
as a present verb tense seems a better fit for the idea of a singleton. Also I renamed the RF24Logger.h file as RF24Logging.h to avoid confusion with the RF24Loggers folder.RF24Log_*()
for some brevityint main()
function in a *.inoRF24LOG_SHORT_DESC
andRF24LOG_TERSE_DESC
RF24LOG_NO_TIMESTAMP
\n
character (both in messages we parse ourselves and at the end of logged messages) can be nullified with the macroRF24_NO_EOL
vendorId
is still output, although passing an empty string as thevendorId
will also skip outputting thevendorId
and its corresponding delimiter. This should provide an easy way to dump formatted data to a file stream.There may be more changes I haven't listed here...