mirror of
https://github.com/Telecominfraproject/wlan-cloud-lib-cppkafka.git
synced 2025-11-20 19:54:51 +00:00
Add operator<< for TopicPartition
This commit is contained in:
@@ -27,10 +27,12 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <librdkafka/rdkafka.h>
|
||||
#include "topic_partition.h"
|
||||
|
||||
using std::string;
|
||||
using std::ostream;
|
||||
|
||||
namespace cppkafka {
|
||||
|
||||
@@ -71,4 +73,8 @@ int64_t TopicPartition::get_offset() const {
|
||||
return offset_;
|
||||
}
|
||||
|
||||
ostream& operator<<(ostream& output, const TopicPartition& rhs) {
|
||||
return output << rhs.get_topic() << "[" << rhs.get_partition() << "]";
|
||||
}
|
||||
|
||||
} // cppkafka
|
||||
|
||||
Reference in New Issue
Block a user