@@ -191,25 +191,7 @@ class Logger {
191
191
* to decrement the internal Logger's counter. */
192
192
void countdown ();
193
193
194
- /* * Check whether next message should be accepted.
195
- * \note See Logger::stream to see how to use it.
196
- * This will modify the counter associated to lineId as if it was
197
- * published. It should thus be used in conjunction with Logger::stream.
198
- */
199
- bool acceptMsg (MsgType m, const std::string& lineId) {
200
- if ((m & MSG_TYPE_TYPE_BITS) < m_lv)
201
- return false ;
202
-
203
- // if print is allowed by current verbosity level
204
- if (isStreamMsg (m)) return checkStreamPeriod (lineId);
205
- return true ;
206
- }
207
-
208
- /* * The most efficient logging method is
209
- * \code
210
- * if (logger.acceptMsg(type, lineId))
211
- * logger.stream() << "my message\n";
212
- * \endcode
194
+ /* * Get an output stream independently of the debug level.
213
195
*/
214
196
RTLoggerStream stream () {
215
197
return ::dynamicgraph::RealTimeLogger::instance ().emptyStream ();
@@ -272,22 +254,22 @@ class Logger {
272
254
return (m & MSG_TYPE_STREAM_BIT);
273
255
}
274
256
275
- bool isDebugMsg (MsgType m) {
276
- return m == MSG_TYPE_DEBUG_STREAM || m == MSG_TYPE_DEBUG;
277
- }
278
-
279
- bool isInfoMsg (MsgType m) {
280
- return m == MSG_TYPE_INFO_STREAM || m == MSG_TYPE_INFO;
281
- }
282
-
283
- bool isWarningMsg (MsgType m) {
284
- return m == MSG_TYPE_WARNING_STREAM || m == MSG_TYPE_WARNING;
285
- }
257
+ /* * Check whether a message of type \m and from \c lineId should be accepted.
258
+ * \note If \c is a stream type, the internal counter associated to \c lineId
259
+ * is updated.
260
+ */
261
+ bool acceptMsg (MsgType m, const std::string& lineId) {
262
+ if ((m & MSG_TYPE_TYPE_BITS) < m_lv)
263
+ return false ;
286
264
287
- bool isErrorMsg (MsgType m) {
288
- return m == MSG_TYPE_ERROR_STREAM || m == MSG_TYPE_ERROR;
265
+ // if print is allowed by current verbosity level
266
+ if (isStreamMsg (m)) return checkStreamPeriod (lineId);
267
+ return true ;
289
268
}
290
269
270
+ /* * Check whether a message from \c lineId should be accepted.
271
+ * \note The internal counter associated to \c lineId is updated.
272
+ */
291
273
bool checkStreamPeriod (const std::string& lineId);
292
274
};
293
275
0 commit comments