Skip to content

Instantly share code, notes, and snippets.

@chaps
Created June 28, 2017 22:51
Show Gist options
  • Save chaps/ad73dea752a71d913135556b7fb3d120 to your computer and use it in GitHub Desktop.
Save chaps/ad73dea752a71d913135556b7fb3d120 to your computer and use it in GitHub Desktop.
spinner test
import logging
from logging_spinner import SpinnerHandler
import time
logger = logging.getLogger('myapp')
logger.setLevel(logging.INFO)
logger.addHandler(SpinnerHandler())
logger = logging.getLogger('myapp.logger')
logger.info('Loading data...', extra={'user_waiting': True})
time.sleep(5)
# some long taking process goes here...
logger.info('Finished loading!', extra={'user_waiting': False})
#At the outest code of the application, setup a SpinnerHandler:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment