import logging


def setUp():
    log = logging.getLogger('elasticsearch.trace')
    log.setLevel(logging.CRITICAL)

import logging


def setUp():
    log = logging.getLogger('elasticsearch.trace')
    log.addHandler(logging.NullHandler())

Use a better method for silencing 'no handlers found' error
Use a better method for silencing 'no handlers found' error

  import logging
  
  
  def setUp():
      log = logging.getLogger('elasticsearch.trace')
-     log.setLevel(logging.CRITICAL)
+     log.addHandler(logging.NullHandler())
  
Use a better method for silencing 'no handlers found' error
## Code Before:
import logging


def setUp():
    log = logging.getLogger('elasticsearch.trace')
    log.setLevel(logging.CRITICAL)

## Instruction:
Use a better method for silencing 'no handlers found' error
## Code After:
import logging


def setUp():
    log = logging.getLogger('elasticsearch.trace')
    log.addHandler(logging.NullHandler())
