Skip to content

Commit 9513e83

Browse files
feat: Implement verbosity
1 parent 30d57c4 commit 9513e83

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/thread/thread.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@ def wrapper(
137137

138138
except SystemExit:
139139
self.status = 'Killed'
140-
print('KILLED ident: %s' % self.ident)
140+
if Settings.VERBOSITY > 'quiet':
141+
print('KILLED ident: %s' % self.ident)
141142
return
142143

143144
return wrapper
@@ -532,8 +533,9 @@ def start(self) -> None:
532533
# Handle abrupt exit
533534
def service_shutdown(signum, frame):
534535
if Settings.GRACEFUL_EXIT_ENABLED:
535-
print('\nCaught signal %d' % signum)
536-
print('Gracefully killing active threads')
536+
if Settings.VERBOSITY > 'quiet':
537+
print('\nCaught signal %d' % signum)
538+
print('Gracefully killing active threads')
537539

538540
for thread in Threads:
539541
if isinstance(thread, Thread):
@@ -545,7 +547,8 @@ def service_shutdown(signum, frame):
545547
):
546548
pass
547549
except Exception:
548-
print('Failed to kill ident: %d' % thread.ident or 0)
550+
if Settings.VERBOSITY > 'quiet':
551+
print('Failed to kill ident: %d' % thread.ident or 0)
549552
sys.exit(0)
550553

551554

0 commit comments

Comments
 (0)