n1nj4z33 / iqoptionapi

IQ Option API 4.x (Python 2.7) The project is obsolete and is not supported because of problems with access to IQ Options in Russia
119 stars 542 forks source link

How to read json respense from api #68

Open iQBotProject opened 6 years ago

iQBotProject commented 6 years ago

i want to read json that written in iqapi.log on live time ws

api_logger = logging.getLogger("iqoptionapi")
    api_file_handler = logging.FileHandler(os.path.join(logs_folder, "iqapi.log"))
    api_file_handler.setLevel(logging.DEBUG)
    api_file_handler.setFormatter(formatter)

    api_logger.addHandler(console_handler)
    api_logger.addHandler(api_file_handler)

thank you for help @n1nj4z33 @fsnlarson @boskiv @freenetwork @PerryAwesome @lucianopinheiro @m10141 @NazirH @EVAZA @Niks005 @freeost @cz3kit @vinydl @leonardomutti @Aiacos @playsten4096 @CZ-DannyK @l9sheen @SonyPony @kanXuT @joelmm1 @MadOne199 @Shirokr @kiddystarnova @HubSpace2000 @frxncisjoseph @rafinha90 @genesiscrew @joelmm1 @Olascoaga @gocholo5 @engelkohle @boskiv @antoinejoerg @Amsori @crypto-maniac @BremerBlizzard @j1and1 @SiliconDare @rimalroc @AllenUchiha @burny91 @santiagonn @0xAalaoui @Aiacos @shiundu @joebrassi

lucianopinheiro commented 6 years ago

On ws/client.py there is the following function: on_message. It grabs the WS messages.

Note the code:

        logger = logging.getLogger(__name__)
        logger.debug(message)

It says "log every received WS message". I don't remember where (my copy of this API is very different today). I guess there is no log for sent messages. But I remember I did it at some point at api.py, I guess.

If you want to read the original message, the place to be is this function.