Skip to content

Commit 8a6e36e

Browse files
harlowjaRoach
authored andcommitted
Use logging instead of traceback (#309)
Instead of just outputting to stderr the rtm connect failure it is more appropriate to use the python logging system and output a appropriate message (and pass in exc_info=True so that the traceback gets logged as well).
1 parent 36cecfa commit 8a6e36e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

slackclient/client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
# mostly a proxy object to abstract how some of this works
33

44
import json
5-
import traceback
5+
import logging
66

77
from .server import Server
88
from .exceptions import ParseResponseError
99

10+
LOG = logging.getLogger(__name__)
11+
1012

1113
class SlackClient(object):
1214
'''
@@ -52,7 +54,7 @@ def rtm_connect(self, with_team_state=True, **kwargs):
5254
self.server.rtm_connect(use_rtm_start=with_team_state, **kwargs)
5355
return self.server.connected
5456
except Exception:
55-
traceback.print_exc()
57+
LOG.warn("Failed RTM connect", exc_info=True)
5658
return False
5759

5860
def api_call(self, method, timeout=None, **kwargs):

0 commit comments

Comments
 (0)