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

logging in your project will damage other logging's output format #166

Open
dc3l1ne opened this issue Jul 12, 2022 · 2 comments
Open

logging in your project will damage other logging's output format #166

dc3l1ne opened this issue Jul 12, 2022 · 2 comments

Comments

@dc3l1ne
Copy link

dc3l1ne commented Jul 12, 2022

Hi ofek!
Your peoject uselogging.debug directly to print debug log, if I defind a logger in my project using code

logger = logging.getLogger("MyLog")
handler  = logging.StreamHandler()
handler.setFormatter(logging.Formatter("%(asctime)s|%(levelname)s|%(name)s|%(message)s"))
logger.addHandler(handler)
logger.setLevel(logging.DEBUG)
logger.debug('some debug info')

This will print a normal debug info : 2022-07-12 14:38:40,173 DEBUG MyLog some debug info
Then I import bit to my project and send some coin

from bit import Key
my_key = Key(...)
outputs=[....]
my_key.send(outputs)

If I run logger.debug('some debug info') again, it will output 2 lines as below

2022-07-12 14:41:10,353	DEBUG	MyLog	some debug info
DEBUG:MyLog:some debug info

Because in bit.transaction.estimate_tx_fee you used logging.debug to print debug info, which corrupted my project logger,kindly recommend you to defind a logger in other py file and then import and use it

@ofek
Copy link
Owner

ofek commented Oct 4, 2022

Can you submit a PR?

@dc3l1ne
Copy link
Author

dc3l1ne commented Nov 18, 2022

Hi, a PR has been submitted, please review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants