Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 18a9e16

Browse files
Change the return behavior for echo() so that the previous value is returned instead.
1 parent 848c75a commit 18a9e16

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎src/ArduinoLogger.h‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,14 @@ class LoggerBase
187187
*
188188
* @param en Echo switch. If true, log statements will also be echo'd to the console through
189189
* printf(). If false, log statements will only go to the log buffer.
190-
* @returns true if echo to console is enabled, false if disabled.
190+
* @returns The prior value that was configured before the call was made, which allows
191+
* users to restore the previous setting if necessary.
191192
*/
192193
bool echo(bool en) noexcept
193194
{
195+
bool setting = echo_;
194196
echo_ = en;
195-
return echo_;
197+
return setting;
196198
}
197199

198200
/** Get the maximum log level (filtering)

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /