MyKings / python-masscan

python-masscan is a python library which helps in using masscan port scanner.
https://pypi.org/project/python-masscan/
GNU General Public License v3.0
281 stars 60 forks source link

How to turn off DEBUG prints? #32

Closed analyserdmz closed 2 years ago

analyserdmz commented 4 years ago

Hello, it would be nice if the DEBUG prints of the library would be optional.

Is there a way of suppressing it?

chppppp commented 4 years ago

So far the best solution I have is to comment out this line in masscan.py

https://github.com/MyKings/python-masscan/blob/master/masscan/masscan.py#L17

If you installed from pip as root it should be at /usr/local/lib/python3.7/dist-packages/masscan/masscan.py

if you installed from pip as a regular user it should be at /home/<YOUR USERNAME>/.local/lib/python3.7/site-packages/masscan/masscan.py

chppppp commented 4 years ago

no wait, i lied. i put the wrong line above. I just edited it.

D4rkSh1ft commented 3 years ago

This worked for me:

import masscan
import logging

masscan.logger.setLevel(logging.INFO)