Skip to content

Instantly share code, notes, and snippets.

@ahmaurya
Created June 27, 2017 01:04
Show Gist options
  • Save ahmaurya/ce692e723de6db88eac37f2f46ac5941 to your computer and use it in GitHub Desktop.
Save ahmaurya/ce692e723de6db88eac37f2f46ac5941 to your computer and use it in GitHub Desktop.
# set up logging
logging.basicConfig(level=logging.INFO,
format='%(asctime)s %(name)s %(levelname)s %(message)s',
datefmt='%Y-%m-%d %H:%M:%S',
filename='log.txt',
filemode='w')
self.logger = logging.getLogger('LogDisplayName')
# setting timezone for correct reading of string datetimestamps
os.environ['TZ'] = 'GMT'
time.tzset()
# for correctly printing numpy arrays, not useful anywhere anymore
np.set_printoptions(threshold=np.inf)
np.seterr(divide='ignore', invalid='ignore')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment