Changeset 13209 for trunk/FACT++


Ignore:
Timestamp:
03/23/12 22:08:54 (13 years ago)
Author:
tbretz
Message:
Implemented fVerbose to switch verbosity of default messages on and off.
Location:
trunk/FACT++/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/Connection.cc

    r13200 r13209  
    8989void Connection::CloseImp(bool restart)
    9090{
    91     if (IsConnected())
     91    if (IsConnected() && fVerbose)
    9292    {
    9393        ostringstream str;
     
    303303        setsockopt(native(), SOL_TCP, TCP_KEEPINTVL, &optval, sizeof(optval));
    304304
    305         Info("Connection established to "+host+"...");
     305        if (fVerbose)
     306            Info("Connection established to "+host+"...");
    306307
    307308        fConnectionStatus = kConnected;
     
    416417    {
    417418        fMsgConnect = msg.str();
    418         ec ? Error(msg) : Info(msg);
     419        if (ec)
     420            Error(msg);
     421        if (!ec && fVerbose)
     422            Info(msg);
    419423    }
    420424
     
    474478
    475479Connection::Connection(ba::io_service& ioservice, ostream &out) :
    476 MessageImp(out), tcp::socket(ioservice), fLog(0),
     480MessageImp(out), tcp::socket(ioservice), fLog(0), fVerbose(true),
    477481fInTimeout(ioservice), fOutTimeout(ioservice), fConnectionTimer(ioservice),
    478482fConnectionStatus(kDisconnected)
  • trunk/FACT++/src/Connection.h

    r11471 r13209  
    2222    boost::asio::ip::tcp::endpoint fEndpoint;
    2323
     24    bool fVerbose;
    2425    bool fDebugTx;
    2526
     
    141142    bool IsConnecting() const   { return fConnectionStatus==kConnecting;   }
    142143
     144    void SetVerbose(bool b=true) { fVerbose=b; }
    143145    void SetDebugTx(bool b=true) { fDebugTx=b; }
    144146
Note: See TracChangeset for help on using the changeset viewer.