Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Try to reduce the instances of 'fail' in the logs so it's easier to find failed tests #549

Merged
merged 2 commits into from
Nov 30, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions common/base/Credentials.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ bool SetUID(uid_t new_uid) {
return false;
#else
if (setuid(new_uid)) {
OLA_WARN << "setuid failed with " << strerror(errno);
OLA_WARN << "setuid(" << new_uid << "): " << strerror(errno);
return false;
}
return true;
Expand All @@ -138,7 +138,7 @@ bool SetGID(gid_t new_gid) {
return false;
#else
if (setgid(new_gid)) {
OLA_WARN << "setgid failed with " << strerror(errno);
OLA_WARN << "setgid(" << new_gid << "): " << strerror(errno);
return false;
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion common/io/IOUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ using std::string;
bool Open(const string &path, int oflag, int *fd) {
*fd = open(path.c_str(), oflag);
if (*fd < 0) {
OLA_WARN << "Failed to open " << path << ": " << strerror(errno);
OLA_WARN << "open(" << path << "): " << strerror(errno);
return false;
}
return true;
Expand Down
2 changes: 1 addition & 1 deletion common/network/Socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ bool UDPSocket::Bind(const IPV4SocketAddress &endpoint) {
#else
if (bind(m_handle, &server_address, sizeof(server_address)) == -1) {
#endif
OLA_WARN << "Failed to bind " << endpoint << ", " << strerror(errno);
OLA_WARN << "bind(" << endpoint << "): " << strerror(errno);
return false;
}
m_bound_to_port = true;
Expand Down
8 changes: 5 additions & 3 deletions common/network/TCPConnector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ TCPConnector::TCPConnectionID TCPConnector::Connect(
if (errno != EINPROGRESS) {
#endif
int error = errno;
OLA_WARN << "connect to " << endpoint << " failed, " << strerror(error);
OLA_WARN << "connect() to " << endpoint << " returned, "
<< strerror(error);
close(sd);
callback->Run(-1, error);
return 0;
Expand Down Expand Up @@ -169,11 +170,12 @@ void TCPConnector::SocketWritable(PendingTCPConnection *connection) {
#else
int r = getsockopt(sd, SOL_SOCKET, SO_ERROR, &error, &len);
#endif
if (r < 0)
if (r < 0) {
error = errno;
}

if (error) {
OLA_WARN << "Failed to connect to " << connection->ip_address << " error "
OLA_WARN << "connect() to " << connection->ip_address << " returned: "
<< strerror(error);
connection->Close();
connection->callback->Run(-1, error);
Expand Down
2 changes: 1 addition & 1 deletion common/network/TCPSocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ TCPSocket* TCPSocket::Connect(const SocketAddress &endpoint) {
int r = connect(sd, &server_address, sizeof(server_address));

if (r) {
OLA_WARN << "connect to " << endpoint << " failed, " << strerror(errno);
OLA_WARN << "connect(" << endpoint << "): " << strerror(errno);
return NULL;
}
TCPSocket *socket = new TCPSocket(sd);
Expand Down
2 changes: 1 addition & 1 deletion common/rdm/DiscoveryAgent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ void DiscoveryAgent::MaybeMuteNextDevice() {
void DiscoveryAgent::IncrementalMuteComplete(bool status) {
if (!status) {
m_uids.RemoveUID(m_muting_uid);
OLA_WARN << "Mute of " << m_muting_uid << " failed, device has gone";
OLA_WARN << "Unable to mute " << m_muting_uid << ", device has gone";
} else {
OLA_DEBUG << "Muted " << m_muting_uid;
}
Expand Down
4 changes: 2 additions & 2 deletions common/rdm/PidStoreLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,11 +340,11 @@ const Descriptor* PidStoreLoader::FrameFormatToDescriptor(
}

// we don't give these descriptors names
const Descriptor *descriptor = new Descriptor("", fields);
const Descriptor *descriptor = new Descriptor("", fields);

if (validate) {
if (!m_checker.CheckConsistency(descriptor)) {
OLA_WARN << "Frame format failed consistency check!";
OLA_WARN << "Invalid frame format";
delete descriptor;
return NULL;
}
Expand Down
2 changes: 1 addition & 1 deletion common/web/JsonLexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ static bool ParseArray(const char **input, JsonParserInterface *parser) {

bool result = ParseTrimmedInput(input, parser);
if (!result) {
OLA_INFO << "input failed";
OLA_INFO << "Invalid input";
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions plugins/usbpro/DmxTriWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ void DmxTriWidgetImpl::SendDiscoveryAuto() {
uint8_t command_id = DISCOVER_AUTO_COMMAND_ID;
if (!SendCommandToTRI(EXTENDED_COMMAND_LABEL, &command_id,
sizeof(command_id))) {
OLA_WARN << "Failed to begin RDM discovery";
OLA_WARN << "Unable to begin RDM discovery";
RDMDiscoveryCallback *callback = m_discovery_callback;
m_discovery_callback = NULL;
RunDiscoveryCallback(callback);
Expand Down Expand Up @@ -595,7 +595,7 @@ void DmxTriWidgetImpl::HandleDiscoverStatResponse(uint8_t return_code,
// These are all fatal
switch (return_code) {
case EC_RESPONSE_MUTE:
OLA_WARN << "Failed to mute device, aborting discovery";
OLA_WARN << "Unable to mute device, aborting discovery";
break;
case EC_RESPONSE_DISCOVERY:
OLA_WARN <<
Expand Down
2 changes: 1 addition & 1 deletion plugins/usbpro/EnttecUsbProWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ void EnttecPortImpl::HandleRDMTimeout(unsigned int length) {
} else if (m_mute_callback) {
MuteDeviceCallback *callback = m_mute_callback;
m_mute_callback = NULL;
OLA_INFO << "Failed to mute device";
OLA_INFO << "Unable to mute device";
callback->Run(false);
} else if (m_branch_callback) {
BranchCallback *callback = m_branch_callback;
Expand Down
2 changes: 1 addition & 1 deletion slp/DATracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ bool DATracker::AddressFromURL(const string &url, IPV4Address *address) {
ok = IPV4Address::FromString(url.substr(m_da_service_prefix.size()),
address);
if (!ok)
OLA_WARN << "Failed to extract IP from "
OLA_WARN << "Unable to extract IP from "
<< url.substr(m_da_service_prefix.size());
} else {
OLA_WARN << url << " did not start with " << m_da_service_prefix;
Expand Down