Skip to content

Adding API to retrieve the debug level. #24

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

Merged
merged 1 commit into from
Jun 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/Arduino_DebugUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ void Arduino_DebugUtils::setDebugLevel(int const debug_level) {
_debug_level = debug_level;
}

int Arduino_DebugUtils::getDebugLevel() const {
return _debug_level;
}

void Arduino_DebugUtils::setDebugOutputStream(Stream * stream) {
_debug_output_stream = stream;
}
Expand Down Expand Up @@ -142,6 +146,11 @@ bool Arduino_DebugUtils::shouldPrint(int const debug_level) const
******************************************************************************/

Arduino_DebugUtils Debug;

void setDebugMessageLevel(int const debug_level) {
Debug.setDebugLevel(debug_level);
}

int getDebugMessageLevel() {
return Debug.getDebugLevel();
}
2 changes: 2 additions & 0 deletions src/Arduino_DebugUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ static int const DBG_DEBUG = 3;
static int const DBG_VERBOSE = 4;

void setDebugMessageLevel(int const debug_level);
int getDebugMessageLevel();

/******************************************************************************
CLASS DECLARATION
Expand All @@ -50,6 +51,7 @@ class Arduino_DebugUtils {
Arduino_DebugUtils();

void setDebugLevel(int const debug_level);
int getDebugLevel() const;

void setDebugOutputStream(Stream * stream);

Expand Down