Repository navigation
Debug and Diagnostics
LibQurl provides tools for tracing network activity and managing time data, primarily for debugging complex transfers.
By default, LibQurl does not log raw packet data. You must explicitly enable it on a per-handle basis:
curl.EnableDebug() ;if using the default easy_handle
curl.EnableDebug(easy_handle) ;for any otherOnce enabled, the library intercepts libcurl's debug callback and stores it until asked.
ConfigureDebug controls which internal events are captured:
; Log everything (text, headers, SSL data, etc)
curl.ConfigureDebug("all")
; Log only SSL handshake data, verbosely
curl.ConfigureDebug("+ssl")
; Exclude header logging
curl.ConfigureDebug("-header")
; Configure multiple components at once via array
curl.ConfigureDebug(["ssl", "+header", "-dns"])
; Disable all logging
curl.ConfigureDebug() ;passes ["-all"]Per the libcurl trace documentation, you can use no prefix ("all"), plus ("+all"), or minus ("-all") to control the debug level for any component. "-all" is equivalent to not calling this in the first place.
Also note that while logging itself is a per-easy_handle operation, specifically which items are configured to be logged is a global setting.
PollDebug formats the captured log entries into a readable string. It filters out raw binary data by default to keep the output clean:
; Returns formatted text log
logText := curl.PollDebug(easy_handle)GetDate parses date strings (RFC 822, RFC 2822, ISO 8601, etc.) into either a native AHK date string or the equivalent Unix epoch time.
; Get AHK Date string (default)
dateStr := curl.GetDate("Thu, 01 Jan 1970 00:00:00 GMT")
; Get raw epoch seconds
epoch := curl.GetDate("Thu, 01 Jan 1970 00:00:00 GMT", 1)PrintObj is a simple tool for recursively formatting AHK Objects, Maps, and Arrays into a human-readable string. It is designed for debugging, inspecting internal library state, and formatting complex data structures for output.
; Inspect a caught error record
if (curl.caughtErrors.Length > 0)
MsgBox curl.PrintObj(curl.caughtErrors[1])
; Inspect a specific handle's active options
MsgBox curl.PrintObj(curl.easyHandleMap[easy_handle]["options"])
; Inspect a custom nested structure
data := Map(
"endpoint", "/api/v1",
"payload", Map("id", 42, "tags", ["a", "b"])
)
MsgBox curl.PrintObj(data)The method automatically detects the type of each value and formats it appropriately, truncating complex binary or file objects to a clear identifier instead of dumping raw bytes:
| Type | Output |
|---|---|
| Default (String, Integer, etc.) | Raw value |
Map / Array / Object
|
Recursively indented, respects depth limit |
Buffer / MemBuffer
|
[BUFFER] |
File |
[FILE] |
| "Magic" downloads | [MAGIC] |
Timestamp generates the current time in various common formats:
; Default: Readable format (yyyy-MM-dd hh:mm:ss.mmm)
MsgBox curl.Timestamp()| Format Name(s) | Example Output |
|---|---|
Readable, SQL, ODBC
|
2025-07-27 15:36:07.746 |
RFC 3339 |
2025-07-27T15:36:07.746Z |
Unix, NTP, GPS, Cocoa
|
1753630567.746 |
asctime |
Sun Jul 27 15:36:07 2025 |
RFC 1123 |
Sun, 27 Jul 2025 15:36:07 GMT |
RFC 2822 |
Sun, 27 Jul 2025 15:36:07 +0000 |
FILETIME |
133502602077460000 |
EXIF |
2025:07:27 15:36:07 |
RFC 850 |
Sunday, 27-Jul-25 15:36:07 GMT |
The Unix value also supports an optional second scale parameter to control its epoch granularity and output type.
curl.Timestamp("Unix") ;returns epoch in seconds = 1753630567
curl.Timestamp("Unix", "seconds") ;same as above = 1753630567
curl.Timestamp("Unix", "float-seconds") ;same but as float = 1753630567.746| Scale Value | Type |
|---|---|
seconds(Default) |
Integer |
ms |
Integer |
ns |
Integer |
us |
Integer |
float-seconds |
Float |
float-ms |
Float |
float-ns |
Float |
float-us |
Float |
-
Easy Handle Reference — full method list including
GetInfo -
Utility Methods Reference —
GetVersionInfo,EncodeBase64, etc.
Foundations
Operations
- Download Modes
- Setting and Listing Options
- Setting and Inspecting Headers
- POST and Upload
- Multiple Easy Handles
- Async and Multi Interface
- URL Construction
- Share Interface
- MIME and Multipart
- Raw Send and Receive
- Pause and Resume
- WebSocket
- SSL Sessions
- Debug and Diagnostics
API Reference
- Easy Handle Reference
- Multi Handle Reference
- Share Handle Reference
- MIME Handle Reference
- URL Handle Reference
- Utility Methods Reference
- WebSocket Reference
Code Snippets