Skip to content

Commit

Permalink
Add a __str__ method to the ClientHandler class
Browse files Browse the repository at this point in the history
So the daemon stop reports:

n1.osvcd.listener stop client handler thread (client addr: 192.168.99.16, usr: lva, auth: x509, scheme: h2)
n1.osvcd.listener stop client handler thread (client addr: local, usr: False, auth: uxsock, scheme: h2)
n1.osvcd.listener stop client handler thread (client addr: local, usr: False, auth: uxsock, scheme: h2)
...

Instead of:

n1.osvcd.listener stop <ClientHandler(Thread-26, started 139992432494336)>
n1.osvcd.listener stop <ClientHandler(Thread-50, started 139992412727040)>
n1.osvcd.listener stop <ClientHandler(Thread-1068, started 139992424101632)>
...
  • Loading branch information
cvaroqui committed Jul 1, 2019
1 parent 954e155 commit 770791f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/osvcd_lsnr.py
Expand Up @@ -584,6 +584,14 @@ def __init__(self, parent, conn, addr, encrypted, scheme, tls, tls_context):
self.usr_grants = {}
self.events_counter = 0

def __str__(self):
return "client handler thread (client addr: %s, usr: %s, auth: %s, scheme: %s)" % (
self.addr[0],
self.usr.svcname if self.usr else self.usr,
self.usr_auth,
self.scheme
)

def run(self):
try:
close = True
Expand Down

0 comments on commit 770791f

Please sign in to comment.