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 05a29b8

Browse files
Only flush if the log buffer is not empty
1 parent 9532f79 commit 05a29b8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

‎src/ArduinoLogger.h‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,13 @@ class LoggerBase
444444
/// Flush the buffered log contents to the target output stream
445445
/// Wrapper for flush_ that resets the overrun_occurred_ flag
446446
/// Can be overridden if desired
447-
virtual void flush() noexcept {
448-
overrun_occurred_ = false;
449-
flush_();
447+
virtual void flush() noexcept
448+
{
449+
if(internal_size() > 0)
450+
{
451+
overrun_occurred_ = false;
452+
flush_();
453+
}
450454
}
451455

452456
/// Clear the contents of the log buffer

0 commit comments

Comments
(0)

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