Changeset 240 in pacpusframework


Ignore:
Timestamp:
Dec 2, 2013, 9:06:33 AM (11 years ago)
Author:
Marek Kurdej
Message:

Fixed: Linux compilation problem

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/PacpusLib/ColorSeverityFormatter.hpp

    r239 r240  
    2323#include <boost/log/expressions.hpp>
    2424#include <boost/log/utility/functional/bind.hpp>
     25#include <sstream>
    2526
    2627// could use Boost.Predef with Boost >= 1.55
     
    138139/// @returns the ANSI color code for the given color. COLOR_DEFAULT is
    139140/// an invalid input.
    140 const char* getAnsiColorCode(Color color)
     141std::string getAnsiColorCode(Color color)
    141142{
    142143    const char* kEscapeSequence = "\033[";
     
    166167    ss << kPostfix;
    167168
    168     return ss.str().c_str();
    169 }
    170 
    171 const char* getAnsiColorCodeRestoreDefault()
     169    return ss.str();
     170}
     171
     172std::string getAnsiColorCodeRestoreDefault()
    172173{
    173174    return "\033[0m";
     
    179180    void operator()(boost::log::basic_formatting_ostream<CharT>& strm, SeverityLevel const& sev)
    180181    {
    181         strm << getAnsiColorCode(getColor(sev));
     182        strm << getAnsiColorCode(getColor(sev)).c_str();
    182183    }
    183184};
     
    187188    void operator()(boost::log::basic_formatting_ostream<CharT>& strm, SeverityLevel const& /*sev*/)
    188189    {
    189         strm << getAnsiColorCodeRestoreDefault();
     190        strm << getAnsiColorCodeRestoreDefault().c_str();
    190191    }
    191192};
Note: See TracChangeset for help on using the changeset viewer.