NibiruChain / py-sdk

Python-based client for interacting with the Nibiru blockchain
MIT License
19 stars 8 forks source link

bug: unexpected logging messages from py-sdk #169

Open onikonychev opened 2 years ago

onikonychev commented 2 years ago

Here and there in liquidator and heart-monitor some unexpected py-sdk messages are appearinng:

12:06:41|DEBUG|_handle_txs| Failed parsing events log: failed to execute message; message index: 0: 0unibi is smaller than 100000000unibi: insufficient funds. Expecting value: line 1 column 1 (char 0)

Need to make sdk and app logging consistent and have an ability to turn off DEBUG if it's not intentionally on.

Unique-Divine commented 1 year ago

What I'd do for this behavior is use argparse from the standard library and add a flag for --log or --loglevel that adjusts the logging.basicConfig. That way, you can customize whether you want to see the DEBUG, INFO, and WARNING statements on different runs.

Another option could be that we add an argument, log_level to the constructor for the nibiru.Sdk object. Then, you'd be able to adjust it at the program level when you initialize the Sdk.

I'm in favor of implementing both of these, tbh