Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slackbridge seemingly does not work #16

Open
seth-stansberry opened this issue Apr 22, 2018 · 3 comments
Open

Slackbridge seemingly does not work #16

seth-stansberry opened this issue Apr 22, 2018 · 3 comments

Comments

@seth-stansberry
Copy link
Contributor

I am in search of debugging advice. I just installed the project yesterday and it looked like a perfect solution for my situation. Shortly I setup bots on both workspace, channels, and set up all of my relevant tokens and populated my ini file according to the README.md.

After debugging for a little while I realized that Heroku support is broken. I was able to fix it from my end and as far as I can tell Heroku is working now as far as being deployable, but the bridge is still not working for me. I tested by running python3 wsgi.py and have not received any error messages... I read through the code line by line but I was not able to find exactly what was wrong. I do not know how to proceed from here.

Recap:

  • Heroku is working [ See: 8698fb59aaebf55018919a66d1b36fa805706d12 ]
  • My individual tokens work based on some commands I ran by hand in IDLE.
  • I do not see any error messages or success messages when running wsgi.py and need help debugging.

Any suggestions for how to debug from here? Appreciate your project!
Seth

@wdoekes
Copy link
Member

wdoekes commented Apr 22, 2018

I suggest you look at the logger. Have it log to stderr/stdout. See:
https://github.com/ossobv/slackbridge/blob/master/wsgi.py#L99
and the stdout/stderr python stream logging handler.

I don't know anything about Heroku myself..

@seth-stansberry
Copy link
Contributor Author

seth-stansberry commented Apr 23, 2018

wdoekes, thanks for your help. I'm not very experienced with the logging module so far and I'm trying to learn. Where exactly do you suggest I put it? https://github.com/ossobv/slackbridge/blob/master/wsgi.py#L85 suggests I place it in slackbridgeconf. I do not see a method or function with that name. It is unclear to me. Should I place it in a file titled slackbrigeconf.py? I have done that but get this error when trying to run the logger. Trying to solve it myself but it's a bit tricky since I haven't worked with logger too much before, nor know your code.

  File "wsgi.py", line 67, in <module>
    from slackbridgeconf import (
  File "/root/slackbridge/slackbridgeconf.py", line 23, in <module>
    logger.setLevel(logging.DEBUG)
NameError: name 'logger' is not defined

Still trying to debug.
Thanks,
Seth

@wdoekes
Copy link
Member

wdoekes commented Apr 25, 2018

That example is not exactly right, I guess.

That logger referenced should be log, the log = logging.getLogger('slackbridge').

Further, you don't need to place it in slackbridgeconf, it only helps if you want to run an unaltered wsgi.py from the git repo. You're free to hack away at wsgi.py directly as much as you please.

This should help you on your way:

>>> import logging
>>> log = logging.getLogger('test')
>>> log.setLevel(logging.DEBUG)
>>> log.debug('hello world')
No handlers could be found for logger "test"
>>> handler = logging.StreamHandler()
>>> log.addHandler(handler)
>>> log.debug('hello world')
hello world

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants