| 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(); |
nothing calls this directly
no test coverage detected