Commit 8e22e9c8 authored by Rafaël Carré's avatar Rafaël Carré

* #6464: replace cout with logger macros

remove a few messages
parent 0110bb6a
......@@ -106,9 +106,6 @@ GainControl::DetectionAverage::DetectionAverage(double sr, double ta, double tr)
{
g_a = exp(-1.0 / (samplingRate * (teta_a / 1000.0)));
g_r = exp(-1.0 / (samplingRate * (teta_r / 1000.0)));
std::cout << "GainControl: g_attack: " << g_a << ", teta_attack: " << teta_a
<< ", g_release: " << g_r << ", teta_release: " << teta_r << std::endl;
}
double GainControl::DetectionAverage::getAverage(double in)
......@@ -125,7 +122,6 @@ double GainControl::DetectionAverage::getAverage(double in)
GainControl::Limiter::Limiter(double r, double thresh) : ratio(r), threshold(thresh)
{
std::cout << "GainControl: limiter threshold: " << threshold << std::endl;
}
double GainControl::Limiter::limit(double in)
......
......@@ -106,9 +106,9 @@ HistoryItem::HistoryItem (std::string serialized_form)
_error("Serialized timeadded: %s", tmp.c_str());
timeAdded = tmp;
break;
default: // error
std::cout << "[ERROR] unserialized form not recognized." << std::endl;
break;
default: // error
_error("Unserialized form %d not recognized\n", indice);
break;
}
indice ++;
......
......@@ -164,7 +164,7 @@ int HistoryManager::save_history_items_map (Conf::ConfigTree *history_list)
if (item->save (&history_list))
items_saved ++;
} else {
std::cout << "[DEBUG]: can't save NULL history item." << std::endl;
_debug("can't save NULL history item\n");
}
iter ++;
......
......@@ -50,7 +50,6 @@ int UrlHook::addAction (std::string field_value, std::string command)
temp = field_value.substr (0, pos);
field_value.erase (0, pos + 1);
args.push_back (temp);
std::cout << temp << " " << std::endl;
}
command_bg = command + " ";
......
......@@ -30,7 +30,7 @@
*/
#include "InstantMessaging.h"
#include "logger.h"
#include "expat.h"
namespace sfl
......@@ -77,7 +77,6 @@ static void XMLCALL startElementCallback (void *userData, const char *name, cons
static void XMLCALL endElementCallback (void * /*userData*/, const char * /*name*/)
{
// std::cout << "endElement " << name << std::endl;
}
......@@ -348,8 +347,8 @@ InstantMessaging::UriList InstantMessaging::parseXmlUriList (std::string& urilis
XML_SetElementHandler (parser, startElementCallback, endElementCallback);
if (XML_Parse (parser, urilist.c_str(), urilist.size(), 1) == XML_STATUS_ERROR) {
std::cout << "Error: " << XML_ErrorString (XML_GetErrorCode (parser))
<< " at line " << XML_GetCurrentLineNumber (parser) << std::endl;
_error("%s at line %lu\n", XML_ErrorString (XML_GetErrorCode (parser)),
XML_GetCurrentLineNumber (parser));
throw InstantMessageException ("Error while parsing uri-list xml content");
}
......
......@@ -301,7 +301,7 @@ bool ManagerImpl::outgoingCall (const std::string& account_id,
_debug ("Manager: Selecting account %s", account_id.c_str());
// Is this accout exist
// Is this account exist
if (!accountExists (account_id)) {
_error ("Manager: Error: Account doesn't exist in new outgoing call");
return false;
......@@ -2540,36 +2540,32 @@ void ManagerImpl::initConfigFile (bool load_user_value, std::string alternate)
struct passwd * user_info = NULL;
user_info = getpwuid (uid);
std::string path;
// Loads config from ~/.sflphone/sflphoned.yml or so..
if (createSettingsPath() == 1 && load_user_value) {
(alternate == "") ? path = _path : path = alternate;
std::cout << path << std::endl;
_path = path;
if (alternate != "")
_path = alternate;
}
_debug ("Manager: configuration file path: %s", path.c_str());
_debug ("Manager: configuration file path: %s", _path.c_str());
bool fileExist = true;
bool out = false;
if (path.empty()) {
if (_path.empty()) {
_error ("Manager: Error: XDG config file path is empty!");
fileExist = false;
}
std::fstream file;
file.open (path.data(), std::fstream::in);
file.open (_path.data(), std::fstream::in);
if (!file.is_open()) {
_debug ("Manager: File %s not opened, create new one", path.c_str());
file.open (path.data(), std::fstream::out);
_debug ("Manager: File %s not opened, create new one", _path.c_str());
file.open (_path.data(), std::fstream::out);
out = true;
if (!file.is_open()) {
......
......@@ -133,9 +133,7 @@ std::vector<CryptoAttribute *> SdesNegotiator::parse (void)
if (tagPattern->matches()) {
try {
// std::cout << "Parsing the tag field";
tag = tagPattern->group ("tag");
// std::cout << ": " << tag << std::endl;
} catch (match_error& exception) {
throw parse_error ("Error while parsing the tag field");
}
......@@ -151,9 +149,7 @@ std::vector<CryptoAttribute *> SdesNegotiator::parse (void)
if (cryptoSuitePattern->matches()) {
try {
// std::cout << "Parsing the crypto suite field";
cryptoSuite = cryptoSuitePattern->group ("cryptoSuite");
// std::cout << ": " << cryptoSuite << std::endl;
} catch (match_error& exception) {
throw parse_error ("Error while parsing the crypto-suite field");
}
......@@ -251,14 +247,16 @@ bool SdesNegotiator::negotiate (void)
_authTagLength = _cryptoSuite.substr (_cryptoSuite.size()-2, 2);
/*
std::cout << "Negotiate tag: " + (*iter_offer)->getTag() << std::endl;
std::cout << "Crypto Suite: " + _cryptoSuite << std::endl;
std::cout << "SRTP Key Method: " + _srtpKeyMethod << std::endl;
std::cout << "SRTP Key Info: " + _srtpKeyInfo << std::endl;
// std::cout << "Lifetime: " + _lifetime << std::endl;
// std::cout << "MKI Value: " + _mkiValue << std::endl;
// std::cout << "MKI Length: " + _mkiLength << std::endl;
std::cout << "Lifetime: " + _lifetime << std::endl;
std::cout << "MKI Value: " + _mkiValue << std::endl;
std::cout << "MKI Length: " + _mkiLength << std::endl;
std::cout << "Auth tag length: " + _authTagLength << std::endl;
*/
}
iter_local++;
......
......@@ -111,24 +111,16 @@ void sdpMedia::add_codec (sfl::Codec* codec)
void sdpMedia::remove_codec (std::string codecName)
{
// Look for the codec by its encoding name
int i;
int size;
std::string enc_name;
std::vector<sfl::Codec*>::iterator iter;
size = _codec_list.size();
std::cout << "vector size: " << size << std::endl;
for (i=0 ; i<size ; i++) {
std::cout << _codec_list[i]->getMimeSubtype().c_str() << std::endl;
size_t size = _codec_list.size();
for (unsigned int i=0 ; i<size ; i++)
if (strcmp (_codec_list[i]->getMimeSubtype().c_str(), codecName.c_str()) == 0) {
std::cout << "erase " <<_codec_list[i]->getMimeSubtype() << std::endl;
iter = _codec_list.begin() +i;
_codec_list.erase (iter);
break;
}
}
}
......
......@@ -2954,8 +2954,6 @@ pjsip_route_hdr *SIPVoIPLink::createRouteSet(Account *account, pj_pool_t *hdr_po
port = "0";
}
std::cout << "Host: " << host << ", Port: " << port << std::endl;
route_set = pjsip_route_hdr_create (hdr_pool);
pjsip_route_hdr *routing = pjsip_route_hdr_create (hdr_pool);
pjsip_sip_uri *url = pjsip_sip_uri_create (hdr_pool, 0);
......@@ -3107,7 +3105,6 @@ void setVoicemailInfo (std::string account, pjsip_msg_body *body)
try {
voicemail_str = msg_body.substr (pos_begin + voice_str.length(), pos_end - (pos_begin + voice_str.length()));
std::cout << "voicemail number : " << voicemail_str << std::endl;
voicemail = atoi (voicemail_str.c_str());
} catch (std::out_of_range& e) {
std::cerr << e.what() << std::endl;
......@@ -4544,8 +4541,6 @@ std::string fetchHeaderValue (pjsip_msg *msg, std::string field)
std::string value, url;
size_t pos;
std::cout << "fetch header value" << std::endl;
/* Convert the field name into pjsip type */
name = pj_str ( (char*) field.c_str());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment