Projet de remplacement du "RPiPasserelle" d'Otec.
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

1234567891011121314151617181920
  1. #!/usr/bin/env python
  2. from os import environ
  3. import logging
  4. FORMAT = '[%(asctime)s][%(levelname)s][%(name)s][%(funcName)s](l.%(lineno)d) %(message)s'
  5. logging.basicConfig(
  6. format=FORMAT,
  7. level=environ.get('LOGLEVEL', logging.INFO))
  8. logger = None
  9. def logger_init():
  10. global logger
  11. flag = not logger
  12. logger = logging.getLogger('pyheatpump')
  13. if flag:
  14. logger.info('Initialized pyHeatpump')
  15. return logger
  16. if __name__ == '__main__':
  17. logger_init()