* debug and error messages now print function name and line number

* add debug messages to trace fake network dissconects
This commit is contained in:
ivan-83 2015-03-19 02:41:29 +03:00
parent 20a1d2b097
commit 307d22ca11
6 changed files with 23 additions and 26 deletions

View File

@ -84,7 +84,6 @@ ITSMFAudioDevice* tsmf_load_audio_device(const char* name, const char* device)
#endif
}
<<<<<<< HEAD
if (audio == NULL)
{
WLog_ERR(TAG, "no sound device.");
@ -92,12 +91,6 @@ ITSMFAudioDevice* tsmf_load_audio_device(const char* name, const char* device)
else
{
WLog_DBG(TAG, "name: %s, device: %s", name, device);
=======
if (audio == NULL) {
WLog_ERR(TAG, "no sound device.");
} else {
WLog_DBG(TAG, "tsmf_load_audio_device: name: %s, device: %s", name, device);
>>>>>>> + tsmf: OSS initial suppot (not work yet)
}
return audio;

View File

@ -280,7 +280,7 @@ static int fastpath_recv_update(rdpFastPath* fastpath, BYTE updateCode, UINT32 s
case FASTPATH_UPDATETYPE_SYNCHRONIZE:
if (!fastpath_recv_update_synchronize(fastpath, s))
WLog_ERR(TAG, "fastpath_recv_update: fastpath_recv_update_synchronize failure but we continue");
WLog_ERR(TAG, "fastpath_recv_update_synchronize failure but we continue");
else
IFCALL(update->Synchronize, context);
break;
@ -288,7 +288,7 @@ static int fastpath_recv_update(rdpFastPath* fastpath, BYTE updateCode, UINT32 s
case FASTPATH_UPDATETYPE_SURFCMDS:
status = update_recv_surfcmds(update, size, s);
if (status < 0)
WLog_DBG(TAG, "fastpath_recv_update: FASTPATH_UPDATETYPE_SURFCMDS - update_recv_surfcmds() - %i", status);
WLog_DBG(TAG, "FASTPATH_UPDATETYPE_SURFCMDS - update_recv_surfcmds() - %i", status);
break;
case FASTPATH_UPDATETYPE_PTR_NULL:
@ -402,7 +402,7 @@ static int fastpath_recv_update_data(rdpFastPath* fastpath, wStream* s)
if (bulkStatus < 0)
{
WLog_ERR(TAG, "fastpath_recv_update_data: bulk_decompress() failed");
WLog_ERR(TAG, "bulk_decompress() failed");
return -1;
}
@ -424,7 +424,7 @@ static int fastpath_recv_update_data(rdpFastPath* fastpath, wStream* s)
{
if (fastpath->fragmentation != -1)
{
WLog_ERR(TAG, "fastpath_recv_update_data: Unexpected FASTPATH_FRAGMENT_SINGLE");
WLog_ERR(TAG, "Unexpected FASTPATH_FRAGMENT_SINGLE");
goto out_fail;
}
@ -453,7 +453,7 @@ static int fastpath_recv_update_data(rdpFastPath* fastpath, wStream* s)
if (totalSize > transport->settings->MultifragMaxRequestSize)
{
WLog_ERR(TAG, "fastpath_recv_update_data: Total size (%d) exceeds MultifragMaxRequestSize (%d)",
WLog_ERR(TAG, "Total size (%d) exceeds MultifragMaxRequestSize (%d)",
totalSize, transport->settings->MultifragMaxRequestSize);
goto out_fail;
}
@ -480,7 +480,7 @@ static int fastpath_recv_update_data(rdpFastPath* fastpath, wStream* s)
if (totalSize > transport->settings->MultifragMaxRequestSize)
{
WLog_ERR(TAG, "fastpath_recv_update_data: Total size (%d) exceeds MultifragMaxRequestSize (%d)",
WLog_ERR(TAG, "Total size (%d) exceeds MultifragMaxRequestSize (%d)",
totalSize, transport->settings->MultifragMaxRequestSize);
goto out_fail;
}
@ -508,7 +508,7 @@ static int fastpath_recv_update_data(rdpFastPath* fastpath, wStream* s)
if (totalSize > transport->settings->MultifragMaxRequestSize)
{
WLog_ERR(TAG, "fastpath_recv_update_data: Total size (%d) exceeds MultifragMaxRequestSize (%d)",
WLog_ERR(TAG, "Total size (%d) exceeds MultifragMaxRequestSize (%d)",
totalSize, transport->settings->MultifragMaxRequestSize);
goto out_fail;
}

View File

@ -210,7 +210,7 @@ BOOL freerdp_check_fds(freerdp* instance)
TerminateEventArgs e;
rdpContext* context = instance->context;
WLog_DBG(TAG, "freerdp_check_fds: rdp_check_fds() - %i", status);
WLog_DBG(TAG, "rdp_check_fds() - %i", status);
EventArgsInit(&e, "freerdp");
e.code = 0;
PubSub_OnTerminate(context->pubSub, context, &e);

View File

@ -1122,7 +1122,7 @@ static int rdp_recv_tpkt_pdu(rdpRdp* rdp, wStream* s)
if (!rdp_read_header(rdp, s, &length, &channelId))
{
WLog_ERR(TAG, "rdp_recv_tpkt_pdu: Incorrect RDP header.");
WLog_ERR(TAG, "Incorrect RDP header.");
return -1;
}
@ -1146,7 +1146,7 @@ static int rdp_recv_tpkt_pdu(rdpRdp* rdp, wStream* s)
{
if (!rdp_decrypt(rdp, s, length - 4, securityFlags))
{
WLog_ERR(TAG, "rdp_recv_tpkt_pdu: rdp_decrypt failed");
WLog_ERR(TAG, "rdp_decrypt failed");
return -1;
}
}
@ -1367,13 +1367,13 @@ int rdp_recv_callback(rdpTransport* transport, wStream* s, void* extra)
case CONNECTION_STATE_LICENSING:
status = rdp_client_connect_license(rdp, s);
if (status < 0)
WLog_DBG(TAG, "rdp_recv_callback: CONNECTION_STATE_LICENSING - rdp_client_connect_license() - %i", status);
WLog_DBG(TAG, "CONNECTION_STATE_LICENSING - rdp_client_connect_license() - %i", status);
break;
case CONNECTION_STATE_CAPABILITIES_EXCHANGE:
status = rdp_client_connect_demand_active(rdp, s);
if (status < 0)
WLog_DBG(TAG, "rdp_recv_callback: CONNECTION_STATE_CAPABILITIES_EXCHANGE - rdp_client_connect_demand_active() - %i", status);
WLog_DBG(TAG, "CONNECTION_STATE_CAPABILITIES_EXCHANGE - rdp_client_connect_demand_active() - %i", status);
break;
case CONNECTION_STATE_FINALIZATION:
@ -1385,13 +1385,13 @@ int rdp_recv_callback(rdpTransport* transport, wStream* s, void* extra)
return 2;
}
if (status < 0)
WLog_DBG(TAG, "rdp_recv_callback: CONNECTION_STATE_FINALIZATION - rdp_recv_pdu() - %i", status);
WLog_DBG(TAG, "CONNECTION_STATE_FINALIZATION - rdp_recv_pdu() - %i", status);
break;
case CONNECTION_STATE_ACTIVE:
status = rdp_recv_pdu(rdp, s);
if (status < 0)
WLog_DBG(TAG, "rdp_recv_callback: CONNECTION_STATE_ACTIVE - rdp_recv_pdu() - %i", status);
WLog_DBG(TAG, "CONNECTION_STATE_ACTIVE - rdp_recv_pdu() - %i", status);
break;
default:
@ -1453,7 +1453,7 @@ int rdp_check_fds(rdpRdp* rdp)
status = rdp_client_redirect(rdp); /* session redirection */
}
if (status < 0)
WLog_DBG(TAG, "rdp_check_fds: transport_check_fds() - %i", status);
WLog_DBG(TAG, "transport_check_fds() - %i", status);
return status;
}

View File

@ -927,7 +927,7 @@ static void* transport_client_thread(void* arg)
if (transport->layer == TRANSPORT_LAYER_CLOSED)
{
WLog_DBG(TAG, "transport_client: TRANSPORT_LAYER_CLOSED");
WLog_DBG(TAG, "TRANSPORT_LAYER_CLOSED");
rdp_set_error_info(rdp, ERRINFO_PEER_DISCONNECTED);
break;
}
@ -941,7 +941,7 @@ static void* transport_client_thread(void* arg)
{
if (!freerdp_check_event_handles(context))
{
WLog_DBG(TAG, "transport_client: freerdp_check_event_handles()");
WLog_DBG(TAG, "freerdp_check_event_handles()");
rdp_set_error_info(rdp, ERRINFO_PEER_DISCONNECTED);
break;
}

View File

@ -216,7 +216,7 @@ int WLog_PrintMessageVA(wLog* log, wLogMessage* message, va_list args)
if (message->Type == WLOG_MESSAGE_TEXT)
{
if (!strchr(message->FormatString, '%'))
if (!strchr(message->FormatString, '%') && message->Level != WLOG_DEBUG && message->Level != WLOG_ERROR)
{
message->TextString = (LPSTR) message->FormatString;
status = WLog_Write(log, message);
@ -224,7 +224,11 @@ int WLog_PrintMessageVA(wLog* log, wLogMessage* message, va_list args)
else
{
char formattedLogMessage[WLOG_MAX_STRING_SIZE];
wvsnprintfx(formattedLogMessage, WLOG_MAX_STRING_SIZE - 1, message->FormatString, args);
int offset = 0;
if (message->Level == WLOG_DEBUG || message->Level == WLOG_ERROR)
offset = snprintf(formattedLogMessage, (WLOG_MAX_STRING_SIZE - 1), "%s, line %i: ", message->FunctionName, message->LineNumber);
wvsnprintfx((formattedLogMessage + offset), ((WLOG_MAX_STRING_SIZE - 1) - offset), message->FormatString, args);
message->TextString = formattedLogMessage;
status = WLog_Write(log, message);
}