Advertisement
METAJIJI

Untitled

Nov 27th, 2015
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3.  
  4.  
  5. import os
  6. import logging
  7. import logging.config
  8. from configparser import ConfigParser
  9. from platform import platform, system as platform_system
  10. import xml.etree.cElementTree as ElementTree
  11.  
  12. __author__ = 'metajiji@gmail.com'
  13. __version__ = '0.01'
  14.  
  15.  
  16. # Setup logger.
  17. logger = logging.getLogger(__name__)
  18. logging_ini = os.path.join(os.path.dirname(__file__), 'logging.ini')
  19. if os.path.exists(logging_ini):
  20. c = ConfigParser(allow_no_value=True)
  21. c.read(logging_ini)
  22. logging.config.fileConfig(logging_ini, disable_existing_loggers=False)
  23. else:
  24. logging.basicConfig(level=logging.INFO)
  25. logger.debug(u'Error loading logger config.')
  26.  
  27. logger.info(u'------------------------------')
  28. logger.info(u'Started on platform: %s.' % platform())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement