Websockets (Verbose Control)

The verbose parameter manages SDK-level logging for WebSocket feed operations (LTP, Quote, Depth). This helps developers toggle between silent mode, basic logs, or full debug-level market data streaming.


Verbose Levels

Level
Value
Description

Silent

False or 0

Errors only (default)

Basic

True or 1

Connection, authentication, subscription logs

Debug

2

All market data updates, including LTP/Quote/Depth


Usage

from openalgo import api

# Silent mode (default) - no SDK output
client = api(api_key="...", host="...", ws_url="...", verbose=False)

# Basic logging - connection/subscription info
client = api(api_key="...", host="...", ws_url="...", verbose=True)

# Full debug - all data updates
client = api(api_key="...", host="...", ws_url="...", verbose=2)

Test Example


Expected Output

verbose=False (Silent)


verbose=True (Basic)


verbose=2 (Full Debug)


Log Categories

Tag
Meaning

[WS]

WebSocket connection events

[AUTH]

Authentication requests & responses

[SUB]

Subscription operations

[UNSUB]

Unsubscription logs

[LTP]

LTP updates (verbose=2)

[QUOTE]

Quote updates (verbose=2)

[DEPTH]

Market depth updates (verbose=2)

[ERROR]

Error messages (always shown)

Last updated

Was this helpful?