code: def do_bugin(self, args):
          
          args = args.split()
          if _debug: ConsoleCmd._debug("do_bugin %r", args)
  
          # get the logger name and logger
          if args:
              loggerName = args[0]
              if loggerName in logging.Logger.manager.loggerDict:
                  logger = logging.getLogger(loggerName)
              else:
                  logger = None
          else:
              loggerName = '__root__'
              logger = logging.getLogger()
  
          # add a logging handler
          if not logger:
              self.stdout.write("not a valid logger name\n")
          elif loggerName in self.handlers:
              self.stdout.write("%s already has a handler\n" % loggerName)
          else:
              handler = ConsoleLogHandler(logger)
              self.handlers[loggerName] = handler
              self.stdout.write("handler to %s added\n" % loggerName)
          self.stdout.write("\n")
docs: bugin [ <logger> ]  - add a console logging handler to a logger