Browse Source

* sane log messages: AddressBook.cpp

pull/317/head
hagen 9 years ago
parent
commit
8170257c26
  1. 15
      AddressBook.cpp

15
AddressBook.cpp

@ -152,10 +152,10 @@ namespace client
num++; num++;
} }
} }
LogPrint (eLogInfo, num, " addresses loaded"); LogPrint (eLogInfo, "Addressbook: ", num, " addresses loaded");
} }
else else
LogPrint (eLogWarning, filename, " not found"); LogPrint (eLogWarning, "Addressbook: ", filename, " not found");
return num; return num;
} }
@ -171,7 +171,7 @@ namespace client
f << it.first << "," << it.second.ToBase32 () << std::endl; f << it.first << "," << it.second.ToBase32 () << std::endl;
num++; num++;
} }
LogPrint (eLogInfo, num, " addresses saved"); LogPrint (eLogInfo, "Addressbook: ", num, " addresses saved");
} }
else else
LogPrint (eLogError, "Can't open file ", filename); LogPrint (eLogError, "Can't open file ", filename);
@ -290,7 +290,7 @@ namespace client
m_Storage = CreateStorage (); m_Storage = CreateStorage ();
m_Storage->AddAddress (ident); m_Storage->AddAddress (ident);
m_Addresses[address] = ident->GetIdentHash (); m_Addresses[address] = ident->GetIdentHash ();
LogPrint (address,"->", ToAddress(ident->GetIdentHash ()), " added"); LogPrint (eLogInfo, "Addressbook: ", address,"->", ToAddress(ident->GetIdentHash ()), " added");
} }
void AddressBook::InsertAddress (std::shared_ptr<const i2p::data::IdentityEx> address) void AddressBook::InsertAddress (std::shared_ptr<const i2p::data::IdentityEx> address)
@ -476,7 +476,7 @@ namespace client
void AddressBookSubscription::Request () void AddressBookSubscription::Request ()
{ {
// must be run in separate thread // must be run in separate thread
LogPrint (eLogInfo, "Downloading hosts from ", m_Link, " ETag: ", m_Etag, " Last-Modified: ", m_LastModified); LogPrint (eLogInfo, "Downloading hosts database from ", m_Link, " ETag: ", m_Etag, " Last-Modified: ", m_LastModified);
bool success = false; bool success = false;
i2p::util::http::url u (m_Link); i2p::util::http::url u (m_Link);
i2p::data::IdentHash ident; i2p::data::IdentHash ident;
@ -591,7 +591,10 @@ namespace client
} }
else else
LogPrint (eLogError, "Can't resolve ", u.host_); LogPrint (eLogError, "Can't resolve ", u.host_);
LogPrint (eLogInfo, "Download complete ", success ? "Success" : "Failed");
if (!success)
LogPrint (eLogError, "Addressbook download failed");
m_Book.DownloadComplete (success); m_Book.DownloadComplete (success);
} }
} }

Loading…
Cancel
Save