1
0
Fork 0

Revert "another attempt to fix logger issues"

This reverts commit c6c9120e33.
This commit is contained in:
jsteemann 2017-03-06 14:30:42 +01:00
parent 79f6a39c23
commit c7acebe3c0
4 changed files with 68 additions and 33 deletions

View File

@ -41,7 +41,6 @@
#include <ostream>
using namespace arangodb;
using namespace arangodb::basics;
Index::Index(
TRI_idx_iid_t iid, arangodb::LogicalCollection* collection,

View File

@ -205,3 +205,63 @@ bool arangodb::basics::TRI_AttributeNamesHaveExpansion(
}
return false;
}
////////////////////////////////////////////////////////////////////////////////
/// @brief append the attribute name to an output stream
////////////////////////////////////////////////////////////////////////////////
std::ostream& operator<<(std::ostream& stream,
arangodb::basics::AttributeName const* name) {
stream << name->name;
if (name->shouldExpand) {
stream << "[*]";
}
return stream;
}
////////////////////////////////////////////////////////////////////////////////
/// @brief append the attribute name to an output stream
////////////////////////////////////////////////////////////////////////////////
std::ostream& operator<<(std::ostream& stream,
arangodb::basics::AttributeName const& name) {
stream << name.name;
if (name.shouldExpand) {
stream << "[*]";
}
return stream;
}
////////////////////////////////////////////////////////////////////////////////
/// @brief append the attribute names to an output stream
////////////////////////////////////////////////////////////////////////////////
std::ostream& operator<<(
std::ostream& stream,
std::vector<arangodb::basics::AttributeName> const* attributes) {
size_t const n = attributes->size();
for (size_t i = 0; i < n; ++i) {
if (i > 0) {
stream << ".";
}
stream << attributes[i];
}
return stream;
}
////////////////////////////////////////////////////////////////////////////////
/// @brief append the attribute names to an output stream
////////////////////////////////////////////////////////////////////////////////
std::ostream& operator<<(
std::ostream& stream,
std::vector<arangodb::basics::AttributeName> const& attributes) {
size_t const n = attributes.size();
for (size_t i = 0; i < n; ++i) {
if (i > 0) {
stream << ".";
}
stream << attributes[i];
}
return stream;
}

View File

@ -85,18 +85,6 @@ struct AttributeName {
static bool namesMatch(std::vector<AttributeName> const&,
std::vector<AttributeName> const&);
friend std::ostream& operator<<(std::ostream& stream, arangodb::basics::AttributeName const* name) {
stream << name->name;
if (name->shouldExpand) {
stream << "[*]";
}
return stream;
}
friend std::ostream& operator<<(std::ostream& stream, arangodb::basics::AttributeName const& name) {
return operator<<(stream, &name);
}
};
////////////////////////////////////////////////////////////////////////////////
@ -138,20 +126,14 @@ void TRI_AttributeNamesJoinNested(std::vector<AttributeName> const& input,
////////////////////////////////////////////////////////////////////////////////
bool TRI_AttributeNamesHaveExpansion(std::vector<AttributeName> const& input);
static inline std::ostream& operator<<(std::ostream& stream,
std::vector<AttributeName> const& attributes) {
size_t const n = attributes.size();
for (size_t i = 0; i < n; ++i) {
if (i > 0) {
stream << ".";
}
stream << attributes[i];
}
return stream;
}
}
}
}
std::ostream& operator<<(std::ostream&, arangodb::basics::AttributeName const*);
std::ostream& operator<<(std::ostream&, arangodb::basics::AttributeName const&);
std::ostream& operator<<(std::ostream&,
std::vector<arangodb::basics::AttributeName> const*);
std::ostream& operator<<(std::ostream&,
std::vector<arangodb::basics::AttributeName> const&);
#endif

View File

@ -78,13 +78,7 @@ class LoggerStream {
template <typename T>
friend LoggerStream& operator<<(LoggerStream& out, T const& obj) {
out._out << obj;
return out;
}
template <typename T>
friend LoggerStream& operator<<(LoggerStream& out, T&& obj) {
out._out << obj;
out << obj;
return out;
}