Skip to content

Commit 17549eb

Browse files
committed
minor simplification.
1 parent b162fb6 commit 17549eb

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/rosmod_actor/include/rosmod_actor/logger.hpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,15 @@ class Logger
133133
if (logs_to_file_) {
134134
log_stream_ << log_content_;
135135
log_stream_.flush();
136-
}
137-
else
136+
} else {
138137
printf("%s", log_content_.c_str());
138+
}
139+
log_content_ = "";
139140
return true;
140-
}
141-
else
141+
} else {
142+
log_content_ = "";
142143
return false;
144+
}
143145
}
144146
}
145147

@@ -151,7 +153,6 @@ class Logger
151153
std::lock_guard<std::recursive_mutex> lk(settings_mutex);
152154
if (is_periodic_ && size() > max_log_unit_) {
153155
write();
154-
log_content_ = "";
155156
return true;
156157
}
157158
}

0 commit comments

Comments
 (0)