Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

CURL.SetDebugWithTime

Sets whether times are included in debug log.

Component Version macOS Windows Linux Server iOS SDK
CURL 6.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "CURL.SetDebugWithTime"; curl; Value )   More

Parameters

Parameter Description Example
curl The CURL session handle. $curl
Value Pass 1 to include times or 0 to not include them. 1

Result

Returns OK or error.

Description

Sets whether times are included in debug log.
This allows you to monitor what happens when.
e.g. see if login takes 10 seconds instead of 0.1.
Default is off.

This must be set before you call CURL.Perform function, so CURL.GetDebugMessages will include timestamps in the log.

Examples

Load text and log with times:

#Start new session
Set Variable [$curl; Value:MBS("CURL.New")]
#Set URL to load (HTTP, HTTPS, FTP, FTPS, SFTP, etc.)
Set Variable [$result; Value:MBS("CURL.SetOptionURL"; $curl; CURL Test::URL)]
#RUN now
Set Field [CURL Test::Result; MBS("CURL.SetDebugWithTime"; $curl; 1)]
Set Field [CURL Test::Result; MBS("CURL.Perform"; $curl)]
#Check result
Set Field [CURL Test::Text; MBS("CURL.GetResultAsText"; $curl; "UTF8")]
Set Field [CURL Test::header; MBS("CURL.GetHeaders"; $curl)]
Set Field [CURL Test::debug; MBS("CURL.GetDebugMessages”; $curl)]
#Cleanup
Set Variable [$result; Value:MBS("CURL.Release"; $curl)]

Enable advanced logging to debug a problem:

# Trace to file with times
Set Variable [ $r; Value: MBS( "Trace"; "/tmp/mbs.log" )
Set Variable [ $r; Value: MBS( "Trace.SetWithTimes"; 1 )
#
# Debug log for CURL with additional data:
Set Variable [ $r; Value: MBS( "CURL.SetDebugWithTime"; $curl; 1 )
Set Variable [ $r; Value: MBS( "CURL.SetDebugWithProgress"; $curl; 1 )
#
# and define some timeouts
Set Variable [ $r; Value: MBS( "CURL.SetOptionConnectTimeoutMS"; $curl; 10000 )

See also

Example Databases

Blog Entries

This function is free to use.

Created 14th May 2016, last changed 27th December 2023


CURL.SetDebugWithProgress - CURL.SetFailedEvaluate