from bfs.bfs10076.system import bfs10102
from logging import StreamHandler, Filter
import logging
import sys
bfs10106 = logging.getLogger(__name__)
class bfs10105(Filter):
  def __init__(self, bfs10107, bfs10110, name=''):
    if bfs10102():
      Filter.__init__(self, name=name)
    else:
      super(bfs10105, self).__init__(name)

    self.bfs10107 = bfs10107
    self.bfs10110 = bfs10110

  def filter(self, bfs10111):
    assert (self.bfs10110 in self.bfs10107.handlers), ('This filter is only intended to be used when log handler %r is among the handlers for logger %r. Did you maybe forget to add the log handler to the logger?' % (self.bfs10110, self.bfs10107))
    bfs10112 = (len(self.bfs10107.handlers) == 1)
    return bfs10112


if (not bfs10106.handlers):
  bfs10113 = StreamHandler(sys.stderr)
  bfs10113.setLevel(logging.WARNING)
  bfs10113.addFilter(bfs10105(bfs10106, bfs10113))
  bfs10106.addHandler(bfs10113)

