tiaf_logger.py 591 B

1234567891011121314151617181920
  1. #
  2. # Copyright (c) Contributors to the Open 3D Engine Project.
  3. # For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. #
  5. # SPDX-License-Identifier: Apache-2.0 OR MIT
  6. #
  7. #
  8. import logging
  9. import sys
  10. def get_logger(name: str):
  11. logger = logging.getLogger(name)
  12. logger.setLevel(logging.INFO)
  13. handler = logging.StreamHandler(sys.stdout)
  14. handler.setLevel(logging.DEBUG)
  15. formatter = logging.Formatter('[%(asctime)s][TIAF][%(levelname)s] %(message)s')
  16. handler.setFormatter(formatter)
  17. logger.addHandler(handler)
  18. return logger