import logging.config
import tornado
from bitstampws import Client as Websocket

import lib.configs.logging
from lib.subscribers import SimpleLoggerSubscriber


logging.config.dictConfig(lib.configs.logging.d)


if __name__ == '__main__':
    with Websocket() as client:
        with SimpleLoggerSubscriber(client):
            client.connect()
            try:
                tornado.ioloop.IOLoop.instance().start()
            except KeyboardInterrupt:
                client.close()


[(13, 'bitstampws.Client', 'Websocket', True, 'from bitstampws import Client as Websocket\n'), (14, 'lib.subscribers.SimpleLoggerSubscriber', 'SimpleLoggerSubscriber', False, 'from lib.subscribers import SimpleLoggerSubscriber\n'), (17, 'tornado.ioloop.IOLoop.instance', 'tornado.ioloop.IOLoop.instance', False, 'import tornado\n')]