logger.py 725 B

1234567891011121314151617181920
  1. # -*- coding: utf-8 -*-
  2. # *****************************************************************************
  3. # Copyright (C) 2006-2020 Jorgen Stenarson. <jorgen.stenarson@bostream.nu>
  4. # Copyright (C) 2020 Bassem Girgis. <brgirgis@gmail.com>
  5. #
  6. # Distributed under the terms of the BSD License. The full license is in
  7. # the file COPYING, distributed as part of this software.
  8. # *****************************************************************************
  9. import logging
  10. import os
  11. from .null_handler import NULLHandler
  12. _default_log_level = os.environ.get("PYREADLINE_LOG", "DEBUG")
  13. LOGGER = logging.getLogger("PYREADLINE")
  14. LOGGER.setLevel(_default_log_level)
  15. LOGGER.propagate = False
  16. LOGGER.addHandler(NULLHandler())