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

Made changes to make logging optional for socket.io module #30

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
8 changes: 5 additions & 3 deletions python/ks_api_client/ks_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ def convertArray(self, array):
return new_array


def subscribe(self, input_tokens, callback, broadcast_host=broadcast_host):
def subscribe(self, input_tokens, callback, broadcast_host=broadcast_host, **kwargs):
try:
if self.consumer_secret == None or not self.consumer_secret:
raise ApiValueError("Please provide the consumer_secret paramater while creating KSTradeApi object or supply in settings file.")
Expand Down Expand Up @@ -386,9 +386,11 @@ def subscribe(self, input_tokens, callback, broadcast_host=broadcast_host):
if 'result' in jsonResponse and 'token' in jsonResponse['result'] and jsonResponse['result']['token']:
parsed_broadcast_host = urllib.parse.urlparse(broadcast_host)
socketio_path = parsed_broadcast_host.path
engineio_logger_bool = kwargs.get("engineio_logger", True)
logger_bool = kwargs.get("logger", True)
self.sio = socketio.Client(
reconnection=True, request_timeout=20, reconnection_attempts=5, engineio_logger=True,
logger=True,http_session=session, ssl_verify=session.verify)
reconnection=True, request_timeout=20, reconnection_attempts=5, engineio_logger=engineio_logger_bool,
logger=logger_bool,http_session=session, ssl_verify=session.verify)

@self.sio.event
def connect():
Expand Down