Coverage for /root/GitHubProjects/impacket/impacket/__init__.py: 56%

# Coverage for /root/GitHubProjects/impacket/impacket/__init__.py : 56%

## 9 statements

Hot-keys on this page

r m x p toggle line displays

j k next/prev highlighted chunk

0 (zero) top of page

1 (one) first highlighted chunk

1# Impacket - Collection of Python classes for working with network protocols.

2#

3# SECUREAUTH LABS. Copyright (C) 2016 SecureAuth Corporation. All rights reserved.

4#

5# This software is provided under a slightly modified version

6# of the Apache Software License. See the accompanying LICENSE file

7# for more information.

8#

9# Author:

10# Alberto Solino (@agsolino)

11#

12

13# Set default logging handler to avoid "No handler found" warnings.

14 import logging

15 try: # Python 2.7+

16 from logging import NullHandler

17 except ImportError:

18 class NullHandler(logging.Handler):

19 def emit(self, record):

20 pass

21

22# All modules inside this library MUST use this logger (impacket)

23# It is up to the library consumer to do whatever is wanted

24# with the logger output. By default it is forwarded to the

25# upstream logger

26

27 LOG = logging.getLogger(__name__)

28 LOG.addHandler(NullHandler())