Skip to content

Instantly share code, notes, and snippets.

@hamdifourati
Created December 26, 2017 09:36
Show Gist options
  • Save hamdifourati/adb3f8f8a35af69187320594e08f9d1e to your computer and use it in GitHub Desktop.
Save hamdifourati/adb3f8f8a35af69187320594e08f9d1e to your computer and use it in GitHub Desktop.
import os
import logging
# Use APP_ENV environment variable to determine app environment
# Default to `production`
APP_ENV = os.getenv('APP_ENV', 'production')
logging.basicConfig(
level=(logging.ERROR if APP_ENV is 'production' else logging.DEBUG )
)
logging.info("This is just a message !")
logging.debug("This is a more verbose message !")
logging.warn("This is a warning !")
logging.error("This is an error !")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment