Skip to content

Commit

Permalink
Fix #163: add apis for log flag query/set
Browse files Browse the repository at this point in the history
  • Loading branch information
terrillmoore committed Apr 21, 2019
1 parent 8629a55 commit 5a1392b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/CatenaBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Revision history:
#define CATENA_ARDUINO_PLATFORM_VERSION_CALC(major, minor, patch, local) \
(((major) << 24u) | ((minor) << 16u) | ((patch) << 8u) | (local))

#define CATENA_ARDUINO_PLATFORM_VERSION CATENA_ARDUINO_PLATFORM_VERSION_CALC(0, 14, 0, 60) /* v0.14.0.60 */
#define CATENA_ARDUINO_PLATFORM_VERSION CATENA_ARDUINO_PLATFORM_VERSION_CALC(0, 14, 0, 61) /* v0.14.0.61 */

#define CATENA_ARDUINO_PLATFORM_VERSION_GET_MAJOR(v) \
(((v) >> 24u) & 0xFFu)
Expand Down
15 changes: 15 additions & 0 deletions src/Catena_Log.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,21 @@ class cLog
) __attribute__((__format__(__printf__, 3, 4)));
/* format counts start with 2 for non-static C++ member fns */

// fetch current log flags
DebugFlags getFlags(void) const
{
return this->m_uDebugFlags;
}

// set log flags and return previous value
DebugFlags setFlags(DebugFlags flags)
{
DebugFlags const oldFlags = this->m_uDebugFlags;

this->m_uDebugFlags = flags;
return oldFlags;
}

private:
DebugFlags m_uDebugFlags;
};
Expand Down

0 comments on commit 5a1392b

Please sign in to comment.