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 10# Set default logging handler to avoid "No handler found" warnings. 11import logging 12try: # Python 2.7+ 13 from logging import NullHandler 14except ImportError: 15 class NullHandler(logging.Handler): 16 def emit(self, record): 17 pass 18 19# All modules inside this library MUST use this logger (impacket) 20# It is up to the library consumer to do whatever is wanted 21# with the logger output. By default it is forwarded to the 22# upstream logger 23 24LOG = logging.getLogger(__name__) 25LOG.addHandler(NullHandler()) 26