Guest User

Untitled

a guest
Oct 20th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. import logging
  2. for iter in xrange(1,cycles+1):
  3. test_dir = pri_sm_ip + "_" + str(initial_time_stamp)
  4. run_dir_path = "run/"+test_dir+"/cycle"+str(iter)
  5.  
  6. try:
  7. os.makedirs(run_dir_path)
  8. except Exception as e:
  9. bs = "error:"+str(e)
  10. print bs
  11.  
  12. log_file_name = str(run_dir_path)+'/zee.log'
  13. logging.basicConfig(level=logging.INFO,
  14. format='%(asctime)s %(levelname)-8s [%(module)-14s:%(lineno)s - %(funcName)-15s] %(message)-10s',
  15. datefmt='%a, %d %b %Y %H:%M:%S',
  16. filename=log_file_name,
  17. filemode='w')
  18. logger = logging.getLogger(__name__)
  19. logging.getLogger("paramiko").setLevel(logging.WARNING)#need this to avoid paramiko info things getting logged
  20. runTests()
Add Comment
Please, Sign In to add comment