Please allow option to either disable "optional" blacklist or disable its output. #33

Closed
opened 2020-11-04 16:58:42 +01:00 by Silverlink34 · 9 comments
Silverlink34 commented 2020-11-04 16:58:42 +01:00 (Migrated from github.com)

I use your module in a command-line utility I've written for our company, every time it starts we get the spitted out info for the blacklist check. We would really appreciate a way to disable this output.

See below:
(note that the '::>' is all you are supposed to see. Its the 'promt' part of the utility but its being covered by the output of blacklist check. My users are confused because they think its still doing something and it is not.)

(MainThread) Lock 2030992950160 acquired on C:\Users\BRANDO1.GAL\AppData\Local\Temp\tmp-py3-validate-email-1\blacklistupdater.lock
(MainThread) Lock 2030992950160 released on C:\Users\BRANDO
1.GAL\AppData\Local\Temp\tmp-py3-validate-email-1\blacklistupdater.lock
(MainThread) Starting optional update of built-in blacklist.
(Thread-1 ) Lock 2030993021976 acquired on C:\Users\BRANDO~1.GAL\AppData\Local\Temp\tmp-py3-validate-email-1\blacklistupdater.lock



||A |||l |||p |||h |||a |||C |||L |||I ||
|||||||||||||||||||||||||
|/|/|/|/|/|/|/|/|


Please enter your command. For a list of commands, use the help command.
For help with a specific command, use help commandName .

::>(Thread-1 ) Lock 2030993021976 released on C:\Users\BRANDO1.GAL\AppData\Local\Temp\tmp-py3-validate-email-1\blacklistupdater.lock
(Thread-1 ) Lock 2030992713376 acquired on C:\Users\BRANDO
1.GAL\AppData\Local\Temp\tmp-py3-validate-email-1\blacklistupdater.lock
(Thread-1 ) Lock 2030992713376 released on C:\Users\BRANDO~1.GAL\AppData\Local\Temp\tmp-py3-validate-email-1\blacklistupdater.lock

I use your module in a command-line utility I've written for our company, every time it starts we get the spitted out info for the blacklist check. We would really appreciate a way to disable this output. See below: (note that the '::>' is all you are supposed to see. Its the 'promt' part of the utility but its being covered by the output of blacklist check. My users are confused because they think its still doing something and it is not.) > (MainThread) Lock 2030992950160 acquired on C:\Users\BRANDO~1.GAL\AppData\Local\Temp\tmp-py3-validate-email-1\blacklistupdater.lock > (MainThread) Lock 2030992950160 released on C:\Users\BRANDO~1.GAL\AppData\Local\Temp\tmp-py3-validate-email-1\blacklistupdater.lock > (MainThread) Starting optional update of built-in blacklist. > (Thread-1 ) Lock 2030993021976 acquired on C:\Users\BRANDO~1.GAL\AppData\Local\Temp\tmp-py3-validate-email-1\blacklistupdater.lock > _________________________________________ > ____ ____ ____ ____ ____ ____ ____ ____ > ||A |||l |||p |||h |||a |||C |||L |||I || > ||__|||__|||__|||__|||__|||__|||__|||__|| > |/__\|/__\|/__\|/__\|/__\|/__\|/__\|/__\| > > _________________________________________ > Please enter your command. For a list of commands, use the help command. > For help with a specific command, use help commandName . > > ::>(Thread-1 ) Lock 2030993021976 released on C:\Users\BRANDO~1.GAL\AppData\Local\Temp\tmp-py3-validate-email-1\blacklistupdater.lock > (Thread-1 ) Lock 2030992713376 acquired on C:\Users\BRANDO~1.GAL\AppData\Local\Temp\tmp-py3-validate-email-1\blacklistupdater.lock > (Thread-1 ) Lock 2030992713376 released on C:\Users\BRANDO~1.GAL\AppData\Local\Temp\tmp-py3-validate-email-1\blacklistupdater.lock >
karolyi commented 2020-11-04 17:15:16 +01:00 (Migrated from github.com)

Hey,

this comes from the file locking module, not from our updater (a module that the updater is using).

Can you tell me what logging settings you use? Per default, no one is supposed to see these lines, as it's internal to the filelock module.

Hey, this comes from the file locking module, not from our updater (a module that the updater is using). Can you tell me what logging settings you use? Per default, no one is supposed to see these lines, as it's internal to the filelock module.
stale[bot] commented 2020-11-18 19:06:38 +01:00 (Migrated from github.com)

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Silverlink34 commented 2020-11-18 19:08:49 +01:00 (Migrated from github.com)

I dont have any logging settings set. So the default

On Wed, Nov 4, 2020, 11:15 AM László Károlyi notifications@github.com
wrote:

Hey,

this comes from the file locking module, not from our updater (a module
that the updater is using).

Can you tell me what logging settings you use? Per default, no one is
supposed to see these lines, as it's internal to the filelock module.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/karolyi/py3-validate-email/issues/33#issuecomment-721827081,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAUHM327HAGCPRJFJDZLKMDSOF42JANCNFSM4TKHFZDA
.

I dont have any logging settings set. So the default On Wed, Nov 4, 2020, 11:15 AM László Károlyi <notifications@github.com> wrote: > Hey, > > this comes from the file locking module, not from our updater (a module > that the updater is using). > > Can you tell me what logging settings you use? Per default, no one is > supposed to see these lines, as it's internal to the filelock module. > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/karolyi/py3-validate-email/issues/33#issuecomment-721827081>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AAUHM327HAGCPRJFJDZLKMDSOF42JANCNFSM4TKHFZDA> > . >
Silverlink34 commented 2020-11-18 19:11:02 +01:00 (Migrated from github.com)

This is all my code does with the module:

from validate_email import validate_email

def checkEmail(*emails):
invalidEmails = []
validEmails = []
for email in emails:
if '@yahoo.com' in email:
print(colored("NOTE: This tool will not be able to check Yahoo emails.
Yahoo's mail server unfortunately reports any @yahoo.com email as valid
until an actual email is sent to it.",'white','on_red'))
print(colored(email,'white','on_red'))
continue

emailIsValid = validate_email(email_address=email, check_regex=True,
check_mx=True, from_address='alphacli@alink.com', helo_host='
officemail.alink.com', smtp_timeout=5, dns_timeout=5, use_blacklist=True,
debug=False)
if emailIsValid:
validEmails.append(email)
else:
invalidEmails.append(email)

print(colored('Valid Emails:','yellow'))
print(colored(validEmails,'green'))
print('')
print(colored('Invalid Emails:','yellow'))
print(colored(invalidEmails,'red'))

On Wed, Nov 18, 2020 at 1:08 PM Brandon G brandongaliher7@gmail.com wrote:

I dont have any logging settings set. So the default

On Wed, Nov 4, 2020, 11:15 AM László Károlyi notifications@github.com
wrote:

Hey,

this comes from the file locking module, not from our updater (a module
that the updater is using).

Can you tell me what logging settings you use? Per default, no one is
supposed to see these lines, as it's internal to the filelock module.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/karolyi/py3-validate-email/issues/33#issuecomment-721827081,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAUHM327HAGCPRJFJDZLKMDSOF42JANCNFSM4TKHFZDA
.

This is all my code does with the module: from validate_email import validate_email def checkEmail(*emails): invalidEmails = [] validEmails = [] for email in emails: if '@yahoo.com' in email: print(colored("NOTE: This tool will not be able to check Yahoo emails. Yahoo's mail server unfortunately reports any @yahoo.com email as valid until an actual email is sent to it.",'white','on_red')) print(colored(email,'white','on_red')) continue emailIsValid = validate_email(email_address=email, check_regex=True, check_mx=True, from_address='alphacli@alink.com', helo_host=' officemail.alink.com', smtp_timeout=5, dns_timeout=5, use_blacklist=True, debug=False) if emailIsValid: validEmails.append(email) else: invalidEmails.append(email) print(colored('Valid Emails:','yellow')) print(colored(validEmails,'green')) print('') print(colored('Invalid Emails:','yellow')) print(colored(invalidEmails,'red')) On Wed, Nov 18, 2020 at 1:08 PM Brandon G <brandongaliher7@gmail.com> wrote: > I dont have any logging settings set. So the default > > On Wed, Nov 4, 2020, 11:15 AM László Károlyi <notifications@github.com> > wrote: > >> Hey, >> >> this comes from the file locking module, not from our updater (a module >> that the updater is using). >> >> Can you tell me what logging settings you use? Per default, no one is >> supposed to see these lines, as it's internal to the filelock module. >> >> — >> You are receiving this because you authored the thread. >> Reply to this email directly, view it on GitHub >> <https://github.com/karolyi/py3-validate-email/issues/33#issuecomment-721827081>, >> or unsubscribe >> <https://github.com/notifications/unsubscribe-auth/AAUHM327HAGCPRJFJDZLKMDSOF42JANCNFSM4TKHFZDA> >> . >> >
karolyi commented 2020-11-19 18:51:14 +01:00 (Migrated from github.com)

Hey,

I've just released 0.2.11, where I've changed the logging to only emit debug() messages instead of info() and warnings when debug=True is passed.

The ones the Filelock module emits, I have no control over. When looking into its source, I saw they use LOGGER.info() to emit some debug logging.

I don't know what logging setup your colored() function (or the module that contains it) does, but even if my module itself doesn't emit messages you don't want to see, you can try and change the default logging settings at startup so you skip the .info() logs the locking module emits.

This way, you could achieve the desired outcome of having absolutely no logs emitted on stdout.

Hey, I've just released 0.2.11, where I've changed the logging to only emit `debug()` messages instead of `info()` and warnings when `debug=True` is passed. The ones the `Filelock` module emits, I have no control over. When looking into its source, I saw they use `LOGGER.info()` to emit some debug logging. I don't know what logging setup your `colored()` function (or the module that contains it) does, but even if my module itself doesn't emit messages you don't want to see, you can try and change the default logging settings at startup so you skip the `.info()` logs the locking module emits. This way, you could achieve the desired outcome of having absolutely no logs emitted on stdout.
Silverlink34 commented 2020-11-19 22:27:58 +01:00 (Migrated from github.com)

I'm not familiar with the logging modules, I typically just print using
default print module. The colored module is a submodule of termcolor.
Allows for some pretty output.

I am not sure if something within those modules is goofing up the Filelock
module you mentioned.

You don't have to give me the direct answer if you don't have it handy,
what logging module should I look up so I can figure out how to change the
default logging settings at the beginning of my script?

On Thu, Nov 19, 2020, 12:51 PM László Károlyi notifications@github.com
wrote:

Hey,

I've just released 0.2.11, where I've changed the logging to only emit
debug() messages instead of info() and warnings when debug=True is passed.

The ones the Filelock module emits, I have no control over. When looking
into its source, I saw they use LOGGER.info() to emit some debug logging.

I don't know what logging setup your colored() function (or the module
that contains it) does, but even if my module itself doesn't emit messages
you don't want to see, you can try and change the default logging settings
at startup so you skip the .info() logs the locking module emits.

This way, you could achieve the desired outcome of having absolutely no
logs emitted on stdout.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/karolyi/py3-validate-email/issues/33#issuecomment-730537365,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAUHM326EANFQ22EQS55VXDSQVLKDANCNFSM4TKHFZDA
.

I'm not familiar with the logging modules, I typically just print using default print module. The colored module is a submodule of termcolor. Allows for some pretty output. I am not sure if something within those modules is goofing up the Filelock module you mentioned. You don't have to give me the direct answer if you don't have it handy, what logging module should I look up so I can figure out how to change the default logging settings at the beginning of my script? On Thu, Nov 19, 2020, 12:51 PM László Károlyi <notifications@github.com> wrote: > Hey, > > I've just released 0.2.11, where I've changed the logging to only emit > debug() messages instead of info() and warnings when debug=True is passed. > > The ones the Filelock module emits, I have no control over. When looking > into its source, I saw they use LOGGER.info() to emit some debug logging. > > I don't know what logging setup your colored() function (or the module > that contains it) does, but even if my module itself doesn't emit messages > you don't want to see, you can try and change the default logging settings > at startup so you skip the .info() logs the locking module emits. > > This way, you could achieve the desired outcome of having absolutely no > logs emitted on stdout. > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/karolyi/py3-validate-email/issues/33#issuecomment-730537365>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AAUHM326EANFQ22EQS55VXDSQVLKDANCNFSM4TKHFZDA> > . >
karolyi commented 2020-11-19 22:44:12 +01:00 (Migrated from github.com)

It's the one in python: https://docs.python.org/3/library/logging.html

If you search around on the internet, you'll find examples on stackoverflow about how to add filters to the logging to filter out the Filelock logging.

It's the one in python: https://docs.python.org/3/library/logging.html If you search around on the internet, you'll find examples on stackoverflow about how to add filters to the logging to filter out the Filelock logging.
Silverlink34 commented 2020-11-20 00:08:38 +01:00 (Migrated from github.com)

Ok! Thank you sir for your help, for identifying that the problem isn't
with your module, and pointing me in the right direction to resolve my
specific case. Much appreciated!!

On Thu, Nov 19, 2020, 4:44 PM László Károlyi notifications@github.com
wrote:

It's the one in python: https://docs.python.org/3/library/logging.html

If you search around on the internet, you'll find examples on
stackoverflow about how to add filters to the logging to filter out the
Filelock logging.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/karolyi/py3-validate-email/issues/33#issuecomment-730655745,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAUHM3YIQEFQO3GAGZKVM63SQWGTZANCNFSM4TKHFZDA
.

Ok! Thank you sir for your help, for identifying that the problem isn't with your module, and pointing me in the right direction to resolve my specific case. Much appreciated!! On Thu, Nov 19, 2020, 4:44 PM László Károlyi <notifications@github.com> wrote: > It's the one in python: https://docs.python.org/3/library/logging.html > > If you search around on the internet, you'll find examples on > stackoverflow about how to add filters to the logging to filter out the > Filelock logging. > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/karolyi/py3-validate-email/issues/33#issuecomment-730655745>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/AAUHM3YIQEFQO3GAGZKVM63SQWGTZANCNFSM4TKHFZDA> > . >
stale[bot] commented 2020-12-04 00:14:13 +01:00 (Migrated from github.com)

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: karolyi/py3-validate-email#33
No description provided.