Set-up application and `tensorflow` logging.

    :param debug: show or hide debug messages
346190
def config_logging(debug: bool = False) -> None:
    
    if debug:
        level = 'DEBUG'
        tf_level = tf.logging.INFO
    else:
        level = 'INFO'
        tf_level = tf.logging.ERROR

    logging_config = config_dict('logging.json')
    for logger in logging_config['loggers'].values():
        logger['level'] = level

    logging.config.dictConfig(logging_config)
    tf.logging.set_verbosity(tf_level)
688862
def debug(*args, **kwargs):
    
    if kwargs.get('file', None) is None:
        kwargs['file'] = sys.stderr
    msg = kwargs.get('sep', ' ').join(str(a) for a in args)
    print('debug: {}'.format(msg), **kwargs)
1038336
def debug(self, msg, *args, **kwargs) -> Task:  # type: ignore
        
        return self._make_log_task(logging.DEBUG, msg, args, **kwargs)
1364193
def _StartDebugger():
  """"""
  global _hub_client
  global _breakpoints_manager

  cdbg_native.InitializeModule(_flags)

  _hub_client = gcp_hub_client.GcpHubClient()
  visibility_policy = _GetVisibilityPolicy()

  _breakpoints_manager = breakpoints_manager.BreakpointsManager(
      _hub_client,
      visibility_policy)

  # Set up loggers for logpoints.
  capture_collector.SetLogger(logging.getLogger())

  capture_collector.CaptureCollector.pretty_printers.append(
      appengine_pretty_printers.PrettyPrinter)

  _hub_client.on_active_breakpoints_changed = (
      _breakpoints_manager.SetActiveBreakpoints)
  _hub_client.on_idle = _breakpoints_manager.CheckBreakpointsExpiration
  _hub_client.SetupAuth(
      _flags.get('project_id'),
      _flags.get('project_number'),
      _flags.get('service_account_json_file'))
  _hub_client.InitializeDebuggeeLabels(_flags)
  _hub_client.Start()
606020
def debugfile(filename, args=None, wdir=None, post_mortem=False):
    
    debugger = pdb.Pdb()
    filename = debugger.canonic(filename)
    debugger._wait_for_mainpyfile = 1
    debugger.mainpyfile = filename
    debugger._user_requested_quit = 0
    if os.name == 'nt':
        filename = filename.replace('\\', '/')
    debugger.run("runfile(%r, args=%r, wdir=%r)" % (filename, args, wdir))
812608
def enable_log(level=logging.DEBUG):
    
    logger = logging.getLogger(__name__)
    logger.setLevel(level)
    if not logger.handlers:
        logger.info('enabling logging to console.')
        logger.addHandler(logging.StreamHandler(sys.stdout))
474465
def debug(*tokens: Token, **kwargs: Any) -> None:
    
    if not CONFIG["verbose"] or CONFIG["record"]:
        return
    message(*tokens, **kwargs)
87727
def debug_flag():
    """"""
    logging.basicConfig(format=consts.LOGGING_FORMAT)

    parser = argparse.ArgumentParser(description=debug_flag.__doc__)
    add_debug(parser)
    args, _extra_args = parser.parse_known_args()

    package, *_ = __package__.split('.')
    logging.getLogger(package).setLevel(args.debug)
256880
def show_logging(level=logging.INFO):
    
    logger = logging.getLogger()

    h = logging.StreamHandler(stream=sys.stderr)
    h.setFormatter(logging.Formatter(fmt="[%(levelname)-8s] %(name)s: %(message)s"))

    logger.addHandler(h)
    logger.setLevel(level)
407302
def launch_debugger(frame, stream=None):
    

    d = {'_frame': frame}  # Allow access to frame object.
    d.update(frame.f_globals)  # Unless shadowed by global
    d.update(frame.f_locals)

    import code, traceback

    i = code.InteractiveConsole(d)
    message = "Signal received : entering python shell.\nTraceback:\n"
    message += ''.join(traceback.format_stack(frame))
    i.interact(message)
731095
def checkdebug(self):
        
        # Global debugging
        opt = self.file_grep(r"^(DEFAULT_LOGGING|DAEMONOPTIONS)=(.*)",
                             *self.files)
        for opt1 in opt:
            for opt2 in opt1.split(" "):
                if opt2 in ("--debug", "debug"):
                    return True
        return False
975390
def debug(self, message, *args, **kwargs):
        
        self._log(logging.DEBUG, message, *args, **kwargs)
1271717
function debug(message) {
            if (enplug.debug) {
                arguments[0] = TAG + arguments[0];
                console.log.apply(console, arguments);
            }
        }
109976
def debug
      ::RSpec.configure do |config|
        config.add_setting :debugger_proc
        config.debugger_proc = ->(ex) do
          exception = ex.exception
          defined?(Pry) ? binding.pry : debugger # rubocop:disable Debugger
        end
        config.after(debug: true) do |ex|
          instance_exec(ex, &config.debugger_proc) if ex.exception
        end
      end
    end
285493
def debug(message = nil, &block)
      logger.add(Logger::DEBUG, message, self.logging_prefix, &block)
    end
23217
def init_debug(self):
        """"""
        import signal

        def debug_trace(sig, frame):
            """Interrupt running process, and provide a python prompt for interactive
            debugging."""

            self.log('Trace signal received')
            self.log(''.join(traceback.format_stack(frame)))

        signal.signal(signal.SIGUSR2, debug_trace)
1214874
def debug(self, group, message):
        '''

        '''
        if group in self.debug_worker:
            if 'stdout' in self.debug_worker:
                print message
            self.log(logging.DEBUG, message)