logs metadata as an XML tree if debug is enabled
506806
static void debugLogMetadata(IIOMetadata metadata, String format)
    {
        if (!logger.isDebugEnabled())
        {
            return;
        }

        // see http://docs.oracle.com/javase/7/docs/api/javax/imageio/
        //     metadata/doc-files/standard_metadata.html
        IIOMetadataNode root = (IIOMetadataNode) metadata.getAsTree(format);
        try
        {
            StringWriter xmlStringWriter = new StringWriter();
            StreamResult streamResult = new StreamResult(xmlStringWriter);
            Transformer transformer = TransformerFactory.newInstance().newTransformer();
            // see http://stackoverflow.com/a/1264872/535646
            transformer.setOutputProperty(OutputKeys.INDENT, "yes");
            transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
            DOMSource domSource = new DOMSource(root);
            transformer.transform(domSource, streamResult);
            logger.debug("\n" + xmlStringWriter);
        }
        catch (Exception e)
        {
            logger.error("Error while reporting meta-data", e);
        }
    }
46681
def debug(self,onOff,level='DEBUG'):
		'''
		
		'''
		if onOff:
			if level == 'DEBUG':
				self.log.setLevel(logging.DEBUG)
				self._ch.setLevel(logging.DEBUG)
				self.log.debug("Debugging level DEBUG enabled")
			elif level == "INFO":
				self.log.setLevel(logging.INFO)
				self._ch.setLevel(logging.INFO)
				self.log.info("Debugging level INFO enabled")
			elif level == "WARN":
				self.log.setLevel(logging.WARN)
				self._ch.setLevel(logging.WARN)
				self.log.warn("Debugging level WARN enabled")
			elif level == "ERROR":
				self.log.setLevel(logging.ERROR)
				self._ch.setLevel(logging.ERROR)
				self.log.error("Debugging level ERROR enabled")
		else:
			self.log.setLevel(logging.ERROR)
			self._ch.setLevel(logging.ERROR)
			self.log.error("Unrecognized debug level `%s`, set to default level `ERROR` instead",level)
1276304
public static void debug(Logger log, String methodName) {
        if (log.isDebugEnabled())
            log.debug(buildMethodLogString(methodName));
    }
67265
@Deprecated
    public static void logDebug(String tag, String message) {
        LogManager.d(tag, message);
    }
824235
def logged(level=logging.DEBUG):
    
    def wrap(f):
        _logger = logging.getLogger("{}.{}".format(f.__module__, f.__name__))

        def wrapped_f(*args, **kwargs):
            _logger.log(level, "Called at {} with args = {} and kwargs = {}"
                        .format(datetime.datetime.now(), args, kwargs))
            data = f(*args, **kwargs)
            _logger.log(level, "Done at {} with args = {} and kwargs = {}"
                        .format(datetime.datetime.now(), args, kwargs))
            return data

        return wrapped_f
    return wrap
999862
def _iter_log_inner(debug):
    
    if debug:
        print('Generating ChangeLog')

    changelog = run('git log --oneline --decorate', hide=True).stdout.strip().decode('utf-8', 'replace')
    for line in changelog.split('\n'):
        line_parts = line.split()
        if len(line_parts) < 2:
            continue
        # Tags are in a list contained in ()'s. If a commit
        # subject that is tagged happens to have ()'s in it
        # this will fail
        if line_parts[1].startswith('(') and ')' in line:
            msg = line.split(')')[1].strip()
        else:
            msg = ' '.join(line_parts[1:])

        if 'tag:' in line:
            tags = set([
                tag.split(',')[0]
                for tag in line.split(')')[0].split('tag: ')[1:]])
        else:
            tags = set()

        yield line_parts[0], tags, msg
261726
private void parseAccessLog(Map<Object, Object> props) {

        String id = (String) props.get(HttpConfigConstants.PROPNAME_ACCESSLOG_ID);
        if (id != null) {
            AtomicReference<AccessLog> aLog = HttpEndpointImpl.getAccessLogger(id);
            if (aLog != null) {
                this.accessLogger = aLog;
            }

            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Config: using logging service", accessLogger);
            }
        }
    }
267171
function ( enabled, debug ) {
		this.logging.enabled = enabled === true;
		this.logging.debug = debug === true;
		this.meshBuilder.setLogging( this.logging.enabled, this.logging.debug );
	}
601264
private static void reloadLog4j2WithXmlConfigFile() {
		
		if(!Boolean.parseBoolean(System.getProperty("log.reload","true"))){
			System.out.println("log.reload:false");
			return;
		}
		String outtype = ResourceUtils.getProperty("log.outtype", "kafka");
		System.out.println("outtype:"+outtype);
		if(StringUtils.equalsIgnoreCase("console", outtype))return;
		
		try {			
			// read log4j configuration from xml
			String log4jConfFileName = "log4j2-"+outtype+".xml";
			InputStream in = loadFileInputStream(log4jConfFileName);
			if(in == null){
				System.err.println("not found log4j configure file["+log4jConfFileName+"] in classpath");
				return ;
			}
			System.out.println("reload log4j from config:"+ log4jConfFileName);
			XmlConfigurationFactory factory = new XmlConfigurationFactory();
			
			
			// init context
			LoggerContext logContext = (LoggerContext) LogManager.getContext(true);
			Configuration configuration = factory.getConfiguration(logContext,new ConfigurationSource(in));
			logContext.stop();
			while(logContext.isStopping()){}
			
			if(logContext.isStopped()){	 
				logContext = (LoggerContext) LogManager.getContext(false);
				logContext.start(configuration);
				System.out.println("LoggerContext reload...");
				//logContext.reconfigure();
				StatusLogger.getLogger().reset();
			}
			while(logContext.isStarting()){}
			if(logContext.isStarted())System.out.println("LoggerContext is started!");
		} catch (Exception e) {
			e.printStackTrace();
		}
		try {jarFile.close();} catch (Exception e) {}
	}
1307215
private void logScanInfo() {
        StringBuilder strBuilder = new StringBuilder(150);
        if (nodeInScopeCount != 0) {
            strBuilder.append("Scanning ");
            strBuilder.append(nodeInScopeCount);
            strBuilder.append(" node(s) ");
        } else {
            strBuilder.append("No nodes to scan ");
        }
        if (parentScanner.getJustScanInScope()) {
            strBuilder.append("[just in scope] ");
        }
        strBuilder.append("from ").append(hostAndPort);
        if (user != null) {
            strBuilder.append(" as ");
            strBuilder.append(user.getName());
        }
        if (nodeInScopeCount == 0) {
            strBuilder.append(", skipping all plugins.");
        }
        log.info(strBuilder.toString());
    }
415869
private void debug(final HttpServletRequest request) {
        if (!logger.isInfoEnabled()) {
            logger.warn("Logger INTO not enabled!");
            return;
        }

        logger.info(HEADERS);
        Enumeration headerEnumeration = request.getHeaderNames();
        while (headerEnumeration.hasMoreElements()) {
            String elementName = (String) headerEnumeration.nextElement();
            logger.info(elementName + " = " + request.getHeader(elementName));
        }

        logger.info(ATTRIBUTES);
        Enumeration attributeEnumeration = request.getAttributeNames();
        while (attributeEnumeration.hasMoreElements()) {
            String elementName = (String) attributeEnumeration.nextElement();
            logger.info(elementName + " = " + request.getAttribute(elementName));
        }

        logger.info(PARAMETERS);
        Map<String, String[]> parameterMap = request.getParameterMap();
        for (Map.Entry<String, String[]> entry : parameterMap.entrySet()) {
            StringBuilder parameterValues = new StringBuilder();
            if (entry.getValue() != null)
                for (String value : entry.getValue()) {
                    parameterValues.append(value);
                    parameterValues.append(' ');
                }
            logger.info(entry.getKey() + " = " + parameterValues);
        }
        HttpSession session = request.getSession(false);
        if (session != null) {
            logger.info("Session = " + session.getId());
            logger.info(SESSION_ATTRIBUTES);

            Enumeration sessionAttrEnumeration = session.getAttributeNames();
            while (sessionAttrEnumeration.hasMoreElements()) {
                String elementName = (String) sessionAttrEnumeration.nextElement();
                logger.info(elementName + " = " + session.getAttribute(elementName));
            }
        }
        logger.info("Remote ip = " + request.getRemoteAddr());
        logger.info("Server name = " + request.getServerName());
        logger.info("Server port = " + request.getServerPort());
    }
761015
def log_config(self):
        '''  '''
        level = self.level
        debug = self.debug
        debug('Logging config:')
        debug('/ name: {}, id: {}', self.name, id(self))
        debug('  .level: %s (%s)', level_map_int[level], level)
        debug('  .default_level: %s (%s)',
                   level_map_int[self.default_level], self.default_level)

        for i, handler in enumerate(self.handlers):
            fmtr = handler.formatter
            debug('  + Handler: %s %r', i, handler)
            debug('    + Formatter: %r', fmtr)
            debug('      .datefmt: %r', fmtr.datefmt)
            debug('      .msgfmt: %r', fmtr._fmt)
            debug('      fmt_style: %r', fmtr._style)
            try:
                debug('      theme styles: %r', fmtr._theme_style)
                debug('      theme icons:\n%r', fmtr._theme_icons)
                debug('      lexer: %r\n', fmtr._lexer)
            except AttributeError:
                pass
513391
public static void infoAndDebug(Logger log, String methodName,
            Object... params) {
        if (!log.isInfoEnabled())
            return;
        int length = params.length;
        Object[] newParams = new Object[length];
        boolean hasCollection = false;
        for (int i = 0; i < length; i++) {
            if (params[i] instanceof Collection) {
                newParams[i] = (((Collection<?>) params[i]).size());
                hasCollection = true;
            } else
                newParams[i] = params[i];
        }
        if (hasCollection)
            log.info(buildMethodLogString(methodName, newParams));
        log.debug(buildMethodLogString(methodName, params));
    }
604580
def debugDumpAttr(self, output, depth):
        
        libxml2mod.xmlDebugDumpAttr(output, self._o, depth)
639437
def debugDumpNode(self, output, depth):
        
        libxml2mod.xmlDebugDumpNode(output, self._o, depth)
164016
public void log(final Metadata metadata) {
        final StringBuilder sb = new StringBuilder();

        for (final MetadataItem item : metadata.getGroupList()) {
            sb.append(LINE);
            sb.append(NEWLINE);
            sb.append(LINE);
            sb.append("Group: " + item.getName());
            sb.append(NEWLINE);
            for (MetadataElement element : item.getElements()) {
                sb.append("  Element  : " + element.getName());
                sb.append(NEWLINE);
                sb.append("  Type     : " + element.getType());
                sb.append(NEWLINE);
                sb.append("  MinOccurs: " + element.getMinOccurs());
                sb.append(NEWLINE);
                sb.append("  MaxOccurs: " + element.getMaxOccurs());
                sb.append(NEWLINE);
                sb.append("  IsAttr   : " + element.getIsAttribute());
                sb.append(NEWLINE);
                sb.append(NEWLINE);
            }

            for (MetadataElement element : item.getReferences()) {
                sb.append("  Ref      : " + element.getRef());
                sb.append(NEWLINE);
            }
            sb.append(NEWLINE);

        }

        for (MetadataEnum enumItem : metadata.getEnumList()) {
            sb.append(LINE);
            sb.append(NEWLINE);
            sb.append("Enum: " + enumItem.getName());
            sb.append(NEWLINE);
            for (String enumValue : enumItem.getValueList()) {
                sb.append("  Value    : " + enumValue);
                sb.append(NEWLINE);
            }
            sb.append(NEWLINE);
        }

        for (MetadataItem item : metadata.getClassList()) {
            sb.append(LINE);
            sb.append(NEWLINE);
            sb.append("Class: " + item.getName());
            sb.append(NEWLINE);
            for (MetadataElement element : item.getElements()) {
                sb.append("  Element  : " + element.getName());
                sb.append(NEWLINE);
                sb.append("  Type     : " + element.getType());
                sb.append(NEWLINE);
                sb.append("  MinOccurs: " + element.getMinOccurs());
                sb.append(NEWLINE);
                sb.append("  MaxOccurs: " + element.getMaxOccurs());
                sb.append(NEWLINE);
                sb.append("  IsAttr   : " + element.getIsAttribute());
                sb.append(NEWLINE);
                sb.append(NEWLINE);
            }

            for (MetadataElement element : item.getReferences()) {
                sb.append("  Ref      : " + element.getRef());
                sb.append(NEWLINE);
            }
            sb.append(NEWLINE);
        }

        for (MetadataItem dataType : metadata.getDataTypeList()) {
            sb.append(LINE);
            sb.append(NEWLINE);
            sb.append("Name    : " + dataType.getName());
            sb.append(NEWLINE);
            sb.append("MappedTo: " + dataType.getMappedTo());
            sb.append(NEWLINE);
        }

        // Log
        log.info(sb.toString());
    }
237046
def activate_debug():
    
    ch = logging.StreamHandler()
    ch.setLevel(logging.DEBUG)
    logger.addHandler(ch)
    logger.setLevel(logging.DEBUG)