A simple logger that duplicates console logs to a file, Dropbox and Telegram.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.



A simple logger that duplicates console logs to a local file, Dropbox and Telegram. More details in this post.

How to use

  • Install package:

     pip install cloudlog
  • Import CloudLog class:

     from cloudlog import CloudLog
  • Log text by simply calling a CloudLog instance:

     log = CloudLog(root_path='~/logs')
     log('Some important stuff happening.')
     log('And again!')
     log('Luckily, it\'s all safe now in a local file.')
  • Add pyplot plots as images in the same folder:

     from matplotlib import pyplot
     # Draw a plot
     x = range(42)
     pyplot.plot(x, x)
     pyplot.xlabel('Amount of logs')
     pyplot.ylabel('Coolness of your app')
     # Call it before calling `pyplot.show()`.


In order to sync your logs and plots to Dropbox:

  • Create a Dropbox app with App folder access type.
  • Get your Dropbox access token and provide it in initialiser.
  • Call sync() in order to dispatch log file to your Dropbox app folder.
log = CloudLog(root_path='~/logs', dropbox_token='YOUR_DROPBOX_TOKEN_HERE')

log('Some important stuff happening again.')
log('Luckily, it\'s all safe now. In the cloud!')

Plots are being synced to Dropbox folder by default.


You may as well get notifications in a Telegram chat, with logs and plots being sent to you.

log = CloudLog(root_path='~/logs', telegram_token='YOUR_TELEGRAM_TOKEN', telegram_chat_id='CHAT_ID')

log('Some important stuff once more.')
log('Luckily, it\'s all safe now in a local file. AND you\'re notified — how cool is that?')

log.sync(notify=True, message='I\'m pregnant.')

Specify the same notify flag for plots for them to be sent to a Telegram chat as well:


Since one may be tempted to dispatch a bunch of updates at the same time, the user will not be notified about messages containing files, such as plots and logs — only about the message passed to sync() method.