5#ifndef ICE_LOGGER_UTIL_H
6#define ICE_LOGGER_UTIL_H
25 std::string
str()
const;
28 std::ostringstream& _stream();
33 std::ostringstream _os;
43 static long testex(...);
45 static const bool value =
sizeof(testex(
static_cast<T*
>(0))) ==
sizeof(
char);
48template<
typename T,
bool = false>
49struct LoggerOutputInserter
51 static inline LoggerOutputBase&
52 insert(LoggerOutputBase& out,
const T& val)
61struct LoggerOutputInserter<T, true>
63 static inline LoggerOutputBase&
64 insert(LoggerOutputBase& out,
const T& ex)
66 return loggerInsert(out, ex);
74 return LoggerOutputInserter<T, IsException<T>::value>::insert(out, val);
77#ifdef ICE_CPP11_MAPPING
78template<typename T, typename ::std::enable_if<::std::is_base_of<::Ice::ObjectPrx, T>::value>::type* =
nullptr>
87 return os << (p ? p->ice_toString() :
"");
93 out._stream() << ex.what();
104template<
class L,
class LPtr,
void (L::*output)(const std::
string&)>
120 std::string s = _stream().str();
157 std::string _category;
#define ICE_API
Definition Config.h:197
Abstract base class for all Ice exceptions.
Definition Exception.h:22
Base class for logger output utility classes.
Definition LoggerUtil.h:21
std::string str() const
Obtains the collected output.
Collects output and flushes it via a logger method.
Definition LoggerUtil.h:106
void flush()
Flushes the colleted output to the logger method.
Definition LoggerUtil.h:118
LoggerOutput(const LPtr &lptr)
Definition LoggerUtil.h:108
~LoggerOutput()
Definition LoggerUtil.h:112
LoggerPlugin(const CommunicatorPtr &communicator, const LoggerPtr &logger)
Constructs the plug-in with a target communicator and a logger.
virtual void initialize()
This method is a no-op.
virtual void destroy()
This method is a no-op.
A communicator plug-in.
Definition Plugin.h:198
Trace(const LoggerPtr &, const std::string &)
Definition BuiltinSequences.h:113
LoggerOutput< Logger, LoggerPtr, &Logger::print > Print
Flushes output to Logger::print.
Definition LoggerUtil.h:135
LoggerOutput< Logger, LoggerPtr, &Logger::warning > Warning
Flushes output to Logger::warning.
Definition LoggerUtil.h:138
::IceInternal::Handle< Logger > LoggerPtr
Definition Logger.h:145
std::ostream & operator<<(std::ostream &out, const ProtocolVersion &version)
Definition Protocol.h:179
::IceInternal::Handle< Communicator > CommunicatorPtr
Definition Communicator.h:608
LoggerOutput< Logger, LoggerPtr, &Logger::error > Error
Flushes output to Logger::error.
Definition LoggerUtil.h:141