void Logger::log(LoggerLogLevel iLevel, const std::string& iLocation, std::ostream& iMessage) { std::ostringstream& message = dynamic_cast<std::ostringstream&>(iMessage); boost::mutex::scoped_lock lock(gLoggerMutex); std::cout << boost::format("%|1$-10s| %|2$-30s| %|100t| %3%\n") % level2Name(iLevel) % iLocation % message.str(); }
//! Report the stack trace info. //! Places information regarding the file and line of the caller, as well as the //! expression itself in the output line of the stream. //! //! @param sexpr String expansion of the expression being evaluated up the //! stack. //! @returns A reference to a constant ErrorHandler instance this. //! const ErrorHandler& ErrorHandler::reportStackInfo(const char* sexpr) const { fprintf(stderr, "[%s:%d] %s: %s\n",file_, line_ ,level2Name(level_), sexpr); return *this; }