Disables logging for the duration of what is being wrapped.  This is
    particularly useful when testing if a test method is supposed to issue an
    error message which is confusing that the error shows for a successful
    test.
558029
def silence_logging(method):
    
    @wraps(method)
    def wrapper(*args, **kwargs):
        logging.disable(logging.ERROR)
        result = method(*args, **kwargs)
        logging.disable(logging.NOTSET)
        return result
    return wrapper
1164460
@Override
  public void close() {
    try {
      if (this.isOpened() == true) {
        this.getTracePrintStream().println();
        this.getTracePrintStream().printf("--> TraceLog closing!%n");
        this.getTracePrintStream().printf("    Time     : %tc%n", new Date());

        System.out.println(formatStreamErrorState() + " Closing ...");

        this.getTracePrintStream().close();
        this.getBufferedOutputStream().close();
        this.fileOutputStream.close();
        this.setOpened(false);
      }
      else {
        System.err.println("WARNING: Tracelog is closed already.");
      }
    }
    catch (IOException ex) {
      ex.printStackTrace(System.err);
    }
  }
922529
def log(self, *args, **kwargs):
        
        if self.suppress_errors:
            try:
                self._log(*args, **kwargs)
                return True
            except:
                return False
        else:
            self._log(*args, **kwargs)
            return True
613216
public synchronized static boolean isLoggingEnabled() {
        switch (SplitlogLoggerFactory.state) {
            case ON:
                return true;
            case OFF:
                return false;
            default:
                final String propertyValue = System.getProperty(SplitlogLoggerFactory.LOGGING_PROPERTY_NAME,
                        SplitlogLoggerFactory.OFF_STATE);
                return propertyValue.equals(SplitlogLoggerFactory.ON_STATE);
        }
    }
126655
function () {
      var args = [], len = arguments.length;
      while ( len-- ) args[ len ] = arguments[ len ];

      if (!settings$2.debug) {
        return;
      }
      args.unshift('DEBUG');
      settings$2.logger.output.apply(null, args);
    }
66326
def _log_function(self, handler):
        
        if handler.get_status() < 400:
            log_method = request_log.info
        elif handler.get_status() < 500:
            log_method = request_log.warning
        else:
            log_method = request_log.error
        for i in settings['LOGGING_IGNORE_URLS']:
            if handler.request.uri.startswith(i):
                log_method = request_log.debug
                break

        request_time = 1000.0 * handler.request.request_time()
        log_method("%d %s %.2fms", handler.get_status(),
                   handler._request_summary(), request_time)
820150
private synchronized void ungetLogService() {
        doWarnIfClosed = doDebug();
        if (log != null) {
            bc.ungetService(logSR);
            logSR = null;
            log = null;
        }
    }
498502
protected void checkLoggingSettings() {
        final LoggingSettings logSettings = settings.getLoggingSettings();
        final LogFile logFileSettings = logSettings.getLogFile();

        if(logFileSettings.getCurrentLogFilename() != null &&
           logFileSettings.isEnabled() == false) {
            LOG.warn("You specified a log file, but have it disabled");
        }

        if(logFileSettings.isEnabled() &&
           logFileSettings.getCurrentLogFilename() == null) {
            throw new IllegalStateException("You enabled logging to a file, but didn't specify the file name");
        }
    }
866202
def set_logging(cfg_obj):
    
    log_status = cfg_obj['LOGGING']['ENABLE_LOGGING']

    if log_status:
        logger.disabled = False
    elif not log_status:
        logger.info(
            '%s: Logging disabled per local configuration file (%s) parameters.' %
            (inspect.stack()[0][3], cfg_obj['PROJECT']['CONFIG_PATH'])
            )
        logger.disabled = True
    return log_status
1303244
public static synchronized void disableTextDestination() {
		if (textHandler != null) {
			Logger.getLogger("").removeHandler(textHandler);
			// ManagerAdmin.getWsHandlerManager().removeWsHandler(textHandler);
			//735356 Before deleting textHandler, we should close the file. Otherwise file remains open and causes hang during log rotation.
			textHandler.stop();			
			textHandler = null;
		}
	}
754471
def _remove_debug_only(self):
        
        LOGGER.debug('Removing debug only from handlers')
        for handler in self.config[self.HANDLERS]:
            if self.DEBUG_ONLY in self.config[self.HANDLERS][handler]:
                del self.config[self.HANDLERS][handler][self.DEBUG_ONLY]
68974
def disable
      jlogger.setLevel(level_off)
      JLogger.getLogger('org').setLevel(level_off)
      JLogger.getLogger('akka').setLevel(level_off)
      JLogger.getRootLogger.setLevel(level_off)
    end
1026095
def stop(self):
        ''''''
        for key, value in self._configs.items():
            self._client.config_set(key, value)
        logs = self._client.execute_command('slowlog', 'get', 100000)
        current = {
            'name': None, 'accumulated': defaultdict(list)
        }
        for _, _, duration, request in logs:
            command = request[0]
            if command == 'slowlog':
                continue
            if 'eval' in command.lower():
                subcommand = request[3]
                self._timings['qless-%s' % subcommand].append(duration)
                if current['name']:
                    if current['name'] not in self._commands:
                        self._commands[current['name']] = defaultdict(list)
                    for key, values in current['accumulated'].items():
                        self._commands[current['name']][key].extend(values)
                current = {
                    'name': subcommand, 'accumulated': defaultdict(list)
                }
            else:
                self._timings[command].append(duration)
                if current['name']:
                    current['accumulated'][command].append(duration)
        # Include the last
        if current['name']:
            if current['name'] not in self._commands:
                self._commands[current['name']] = defaultdict(list)
            for key, values in current['accumulated'].items():
                self._commands[current['name']][key].extend(values)
1215896
def handle_logging(self):
        

        configure_logging(self.get_scrapy_options())

        # Disable duplicates
        self.__scrapy_options["LOG_ENABLED"] = False

        # Now, after log-level is correctly set, lets log them.
        for msg in self.log_output:
            if msg["level"] is "error":
                self.log.error(msg["msg"])
            elif msg["level"] is "info":
                self.log.info(msg["msg"])
            elif msg["level"] is "debug":
                self.log.debug(msg["msg"])
1309469
public void stop_logging () {
   		Vector dl = Util.instance().get_device_list("*");
        for (Object aDl : dl) {
            ((DeviceImpl) aDl).stop_logging();
        }
    }
1004197
private void suppressSeleniumJavaUtilLogging() {
        if ( ! seleniumLoggingSuppressed.getAndSet(true) ) {
            try {
                // Log4j logging is annoyingly difficult to turn off, it usually requires a config file but we can also do it with an InputStream
                Properties properties = new Properties();
                properties.setProperty("org.openqa.selenium.remote.ProtocolHandshake.level", "OFF");
                properties.setProperty("org.openqa.selenium.remote.ProtocolHandshake.useParentHandlers", "false");

                ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
                properties.store(byteArrayOutputStream, "seleniumLoggingProperties");
                byte[] bytes = byteArrayOutputStream.toByteArray();

                ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(bytes);
                LogManager.getLogManager().readConfiguration(byteArrayInputStream);
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
938602
synchronized void closedLog(KCVSLog log) {
        KCVSLog l = openLogs.remove(log.getName());
        assert l==log;
    }