MCPcopy Create free account
hub / github.com/Xtra-Computing/thundersvm / convertTemplateToStdString

Method convertTemplateToStdString

include/thundersvm/util/log.h:3769–3787  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3767 /// @brief Converts template to std::string - useful for loggable classes to log containers within log(std::ostream&) const
3768 template <typename T>
3769 static std::string convertTemplateToStdString(const T& templ) {
3770 el::Logger* logger =
3771 ELPP->registeredLoggers()->get(el::base::consts::kDefaultLoggerId);
3772 if (logger == nullptr) {
3773 return std::string();
3774 }
3775 base::MessageBuilder b;
3776 b.initialize(logger);
3777 logger->acquireLock();
3778 b << templ;
3779#if defined(ELPP_UNICODE)
3780 std::string s = std::string(logger->stream().str().begin(), logger->stream().str().end());
3781#else
3782 std::string s = logger->stream().str();
3783#endif // defined(ELPP_UNICODE)
3784 logger->stream().str(ELPP_LITERAL(""));
3785 logger->releaseLock();
3786 return s;
3787 }
3788 /// @brief Returns command line arguments (pointer) provided to easylogging++
3789 static inline const el::base::utils::CommandLineArgs* commandLineArgs(void) {
3790 return ELPP->commandLineArgs();

Callers

nothing calls this directly

Calls 7

registeredLoggersMethod · 0.80
initializeMethod · 0.80
acquireLockMethod · 0.80
endMethod · 0.80
releaseLockMethod · 0.80
getMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected