__init__.py 777 B

12345678910111213141516171819202122232425
  1. # Copyright (c) 2003-2016 CORE Security Technologies
  2. #
  3. # This software is provided under under a slightly modified version
  4. # of the Apache Software License. See the accompanying LICENSE file
  5. # for more information.
  6. #
  7. # Author: Alberto Solino (@agsolino)
  8. #
  9. # Set default logging handler to avoid "No handler found" warnings.
  10. import logging
  11. try: # Python 2.7+
  12. from logging import NullHandler
  13. except ImportError:
  14. class NullHandler(logging.Handler):
  15. def emit(self, record):
  16. pass
  17. # All modules inside this library MUST use this logger (impacket)
  18. # It is up to the library consumer to do whatever is wanted
  19. # with the logger output. By default it is forwarded to the
  20. # upstream logger
  21. LOG = logging.getLogger(__name__)
  22. LOG.addHandler(NullHandler())