当前位置: 首页>>代码示例>>Java>>正文


Java Util.report方法代码示例

本文整理汇总了Java中org.slf4j.helpers.Util.report方法的典型用法代码示例。如果您正苦于以下问题:Java Util.report方法的具体用法?Java Util.report怎么用?Java Util.report使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.slf4j.helpers.Util的用法示例。


在下文中一共展示了Util.report方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: lookUpConfiguredLoggerFactory

import org.slf4j.helpers.Util; //导入方法依赖的package包/类
private Set<Class<? extends ILoggerFactory>> lookUpConfiguredLoggerFactory() {
    final Set<Class<? extends ILoggerFactory>> loggerFactories = new HashSet<>();

    final String configuredLoggerFactory = System.getProperty(ENVIRONMENT_VAR_LOGGER_FACTORY);
    if (StringUtils.isNotBlank(configuredLoggerFactory)) {
        Util.report("Instructed logger factory to use is " + configuredLoggerFactory);
        try {
            final Class clazz = Class.forName(configuredLoggerFactory);
            loggerFactories.add(clazz);
        } catch (final Exception e) {
            Util.report("Could not locate the provided logger factory: " + configuredLoggerFactory + ". Error: " + e.getMessage());
        }
    }

    return loggerFactories;
}
 
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:17,代码来源:CasLoggerFactory.java

示例2: computeTargetStream

import org.slf4j.helpers.Util; //导入方法依赖的package包/类
private static PrintStream computeTargetStream(String logFile) {
  if ("System.err".equalsIgnoreCase(logFile))
    return System.err; // NOSONAR
  else if ("System.out".equalsIgnoreCase(logFile)) {
    return System.out; // NOSONAR
  } else {
    try {
      FileOutputStream fos = new FileOutputStream(logFile);
      PrintStream printStream = new PrintStream(fos);
      return printStream;
    } catch (FileNotFoundException e) {
      Util.report("Could not open [" + logFile + "]. Defaulting to System.err", e);
      return System.err; // NOSONAR
    }
  }
}
 
开发者ID:AmadeusITGroup,项目名称:HttpSessionReplacer,代码行数:17,代码来源:SimpleLogger.java

示例3: init

import org.slf4j.helpers.Util; //导入方法依赖的package包/类
void init() {
    try {
        try {
            (new KonkerContextInitializer(this.defaultLoggerContext)).autoConfig();
        } catch (JoranException var2) {
            Util.report("Failed to auto configure default logger context", var2);
        }

        if(!StatusUtil.contextHasStatusListener(this.defaultLoggerContext)) {
            StatusPrinter.printInCaseOfErrorsOrWarnings(this.defaultLoggerContext);
        }

        this.contextSelectorBinder.init(this.defaultLoggerContext, KEY);
        this.initialized = true;
    } catch (Throwable var3) {
        Util.report("Failed to instantiate [" + LoggerContext.class.getName() + "]", var3);
    }

}
 
开发者ID:KonkerLabs,项目名称:konker-platform,代码行数:20,代码来源:KonkerStaticLoggerBinder.java

示例4: fixSubstitutedLoggers

import org.slf4j.helpers.Util; //导入方法依赖的package包/类
private static final void fixSubstitutedLoggers() {
    List loggers = TEMP_FACTORY.getLoggers();
    if(!loggers.isEmpty()) {
        Util.report("The following set of substitute loggers may have been accessed");
        Util.report("during the initialization phase. Logging calls during this");
        Util.report("phase were not honored. However, subsequent logging calls to these");
        Util.report("loggers will work as normally expected.");
        Util.report("See also http://www.slf4j.org/codes.html#substituteLogger");
        Iterator i$ = loggers.iterator();

        while(i$.hasNext()) {
            SubstituteLogger subLogger = (SubstituteLogger)i$.next();
            subLogger.setDelegate(getKonkerLogger(subLogger.getName()));
            Util.report(subLogger.getName());
        }

        TEMP_FACTORY.clear();
    }
}
 
开发者ID:KonkerLabs,项目名称:konker-platform,代码行数:20,代码来源:KonkerLoggerFactory.java

示例5: versionSanityCheck

import org.slf4j.helpers.Util; //导入方法依赖的package包/类
private static final void versionSanityCheck() {
    try {
        String e = StaticLoggerBinder.REQUESTED_API_VERSION;
        boolean match = false;
        String[] arr$ = API_COMPATIBILITY_LIST;
        int len$ = arr$.length;

        for(int i$ = 0; i$ < len$; ++i$) {
            String aAPI_COMPATIBILITY_LIST = arr$[i$];
            if(e.startsWith(aAPI_COMPATIBILITY_LIST)) {
                match = true;
            }
        }

        if(!match) {
            Util.report("The requested version " + e + " by your slf4j binding is not compatible with " + Arrays.asList(API_COMPATIBILITY_LIST).toString());
            Util.report("See http://www.slf4j.org/codes.html#version_mismatch for further details.");
        }
    } catch (NoSuchFieldError var6) {
        ;
    } catch (Throwable var7) {
        Util.report("Unexpected problem occured during version sanity check", var7);
    }

}
 
开发者ID:KonkerLabs,项目名称:konker-platform,代码行数:26,代码来源:KonkerLoggerFactory.java

示例6: findPossibleStaticLoggerBinderPathSet

import org.slf4j.helpers.Util; //导入方法依赖的package包/类
static Set<URL> findPossibleStaticLoggerBinderPathSet() {
    LinkedHashSet staticLoggerBinderPathSet = new LinkedHashSet();

    try {
        ClassLoader ioe = LoggerFactory.class.getClassLoader();
        Enumeration paths;
        if(ioe == null) {
            paths = ClassLoader.getSystemResources(STATIC_LOGGER_BINDER_PATH);
        } else {
            paths = ioe.getResources(STATIC_LOGGER_BINDER_PATH);
        }

        while(paths.hasMoreElements()) {
            URL path = (URL)paths.nextElement();
            staticLoggerBinderPathSet.add(path);
        }
    } catch (IOException var4) {
        Util.report("Error getting resources from path", var4);
    }

    return staticLoggerBinderPathSet;
}
 
开发者ID:KonkerLabs,项目名称:konker-platform,代码行数:23,代码来源:KonkerLoggerFactory.java

示例7: reportMultipleBindingAmbiguity

import org.slf4j.helpers.Util; //导入方法依赖的package包/类
private static void reportMultipleBindingAmbiguity(Set<URL> staticLoggerBinderPathSet) {
    if(!isAndroid()) {
        if(isAmbiguousStaticLoggerBinderPathSet(staticLoggerBinderPathSet)) {
            Util.report("Class path contains multiple SLF4J bindings.");
            Iterator i$ = staticLoggerBinderPathSet.iterator();

            while(i$.hasNext()) {
                URL path = (URL)i$.next();
                Util.report("Found binding in [" + path + "]");
            }

            Util.report("See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.");
        }

    }
}
 
开发者ID:KonkerLabs,项目名称:konker-platform,代码行数:17,代码来源:KonkerLoggerFactory.java

示例8: init

import org.slf4j.helpers.Util; //导入方法依赖的package包/类
static void init() {
    INITIALIZED = true;
    loadProperties();

    String defaultLogLevelString = getStringProperty( DEFAULT_LOG_LEVEL_KEY, null );
    if ( defaultLogLevelString != null )
        DEFAULT_LOG_LEVEL = stringToLevel( defaultLogLevelString );

    SHOW_LOG_NAME = getBooleanProperty( SHOW_LOG_NAME_KEY, SHOW_LOG_NAME );
    SHOW_SHORT_LOG_NAME = getBooleanProperty( SHOW_SHORT_LOG_NAME_KEY, SHOW_SHORT_LOG_NAME );
    SHOW_DATE_TIME = getBooleanProperty( SHOW_DATE_TIME_KEY, SHOW_DATE_TIME );
    SHOW_THREAD_NAME = getBooleanProperty( SHOW_THREAD_NAME_KEY, SHOW_THREAD_NAME );
    DATE_TIME_FORMAT_STR = getStringProperty( DATE_TIME_FORMAT_KEY, DATE_TIME_FORMAT_STR );
    LEVEL_IN_BRACKETS = getBooleanProperty( LEVEL_IN_BRACKETS_KEY, LEVEL_IN_BRACKETS );
    WARN_LEVEL_STRING = getStringProperty( WARN_LEVEL_STRING_KEY, WARN_LEVEL_STRING );

    if ( DATE_TIME_FORMAT_STR != null ) {
        try {
            DATE_FORMATTER = new SimpleDateFormat( DATE_TIME_FORMAT_STR );
        } catch ( IllegalArgumentException e ) {
            Util.report( "Bad date format in " + CONFIGURATION_FILE + "; will output relative time", e );
        }
    }
}
 
开发者ID:renatoathaydes,项目名称:osgiaas,代码行数:25,代码来源:LogServiceForwardingLogger.java

示例9: computeTargetStream

import org.slf4j.helpers.Util; //导入方法依赖的package包/类
private static PrintStream computeTargetStream( String logFile ) {
    if ( "System.err".equalsIgnoreCase( logFile ) )
        return System.err;
    else if ( "System.out".equalsIgnoreCase( logFile ) ) {
        return System.out;
    } else {
        try {
            FileOutputStream fos = new FileOutputStream( logFile );
            PrintStream printStream = new PrintStream( fos );
            return printStream;
        } catch ( FileNotFoundException e ) {
            Util.report( "Could not open [" + logFile + "]. Defaulting to System.err", e );
            return System.err;
        }
    }
}
 
开发者ID:renatoathaydes,项目名称:osgiaas,代码行数:17,代码来源:LogServiceForwardingLogger.java

示例10: fixSubstitutedLoggers

import org.slf4j.helpers.Util; //导入方法依赖的package包/类
private final static void fixSubstitutedLoggers() {
    List<SubstituteLogger> loggers = TEMP_FACTORY.getLoggers();

    if (loggers.isEmpty()) {
        return;
    }

    Util.report("The following set of substitute loggers may have been accessed");
    Util.report("during the initialization phase. Logging calls during this");
    Util.report("phase were not honored. However, subsequent logging calls to these");
    Util.report("loggers will work as normally expected.");
    Util.report("See also " + SUBSTITUTE_LOGGER_URL);
    for (SubstituteLogger subLogger : loggers) {
        subLogger.setDelegate(getLogger(subLogger.getName()));
        Util.report(subLogger.getName());
    }

    TEMP_FACTORY.clear();
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:20,代码来源:LoggerFactory.java

示例11: versionSanityCheck

import org.slf4j.helpers.Util; //导入方法依赖的package包/类
private final static void versionSanityCheck() {
    try {
        String requested = StaticLoggerBinder.REQUESTED_API_VERSION;

        boolean match = false;
        for (int i = 0; i < API_COMPATIBILITY_LIST.length; i++) {
            if (requested.startsWith(API_COMPATIBILITY_LIST[i])) {
                match = true;
            }
        }
        if (!match) {
            Util.report("The requested version " + requested + " by your slf4j binding is not compatible with "
                            + Arrays.asList(API_COMPATIBILITY_LIST).toString());
            Util.report("See " + VERSION_MISMATCH + " for further details.");
        }
    } catch (java.lang.NoSuchFieldError nsfe) {
        // given our large user base and SLF4J's commitment to backward
        // compatibility, we cannot cry here. Only for implementations
        // which willingly declare a REQUESTED_API_VERSION field do we
        // emit compatibility warnings.
    } catch (Throwable e) {
        // we should never reach here
        Util.report("Unexpected problem occured during version sanity check", e);
    }
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:26,代码来源:LoggerFactory.java

示例12: findPossibleStaticLoggerBinderPathSet

import org.slf4j.helpers.Util; //导入方法依赖的package包/类
private static Set<URL> findPossibleStaticLoggerBinderPathSet() {
    // use Set instead of list in order to deal with bug #138
    // LinkedHashSet appropriate here because it preserves insertion order during iteration
    Set<URL> staticLoggerBinderPathSet = new LinkedHashSet<URL>();
    try {
        ClassLoader loggerFactoryClassLoader = LoggerFactory.class.getClassLoader();
        Enumeration<URL> paths;
        if (loggerFactoryClassLoader == null) {
            paths = ClassLoader.getSystemResources(STATIC_LOGGER_BINDER_PATH);
        } else {
            paths = loggerFactoryClassLoader.getResources(STATIC_LOGGER_BINDER_PATH);
        }
        while (paths.hasMoreElements()) {
            URL path = (URL) paths.nextElement();
            staticLoggerBinderPathSet.add(path);
        }
    } catch (IOException ioe) {
        Util.report("Error getting resources from path", ioe);
    }
    return staticLoggerBinderPathSet;
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:22,代码来源:LoggerFactory.java

示例13: computeTargetStream

import org.slf4j.helpers.Util; //导入方法依赖的package包/类
private static PrintStream computeTargetStream(String logFile) {
    if ("System.err".equalsIgnoreCase(logFile))
        return System.err;
    else if ("System.out".equalsIgnoreCase(logFile)) {
        return System.out;
    } else {
        try {
            FileOutputStream fos = new FileOutputStream(logFile);
            PrintStream printStream = new PrintStream(fos);
            return printStream;
        } catch (FileNotFoundException e) {
            Util.report("Could not open [" + logFile + "]. Defaulting to System.err", e);
            return System.err;
        }
    }
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:17,代码来源:SimpleLogger.java

示例14: init

import org.slf4j.helpers.Util; //导入方法依赖的package包/类
/**
 * Package access for testing purposes.
 */
void init() {
  try {
    try {
      new ContextInitializer(defaultLoggerContext).autoConfig();
    } catch (JoranException je) {
      Util.report("Failed to auto configure default logger context", je);
    }
    // logback-292
    if(!StatusUtil.contextHasStatusListener(defaultLoggerContext)) {
      StatusPrinter.printInCaseOfErrorsOrWarnings(defaultLoggerContext);
    }
    contextSelectorBinder.init(defaultLoggerContext, KEY);
    initialized = true;
  } catch (Throwable t) {
    // we should never get here
    Util.report("Failed to instantiate [" + LoggerContext.class.getName()
        + "]", t);
  }
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:23,代码来源:StaticLoggerBinder.java

示例15: versionSanityCheck

import org.slf4j.helpers.Util; //导入方法依赖的package包/类
private final static void versionSanityCheck() {
    try {
        String requested = requestedApiVersion();

        boolean match = false;
        for (String element : API_COMPATIBILITY_LIST) {
            if (requested.startsWith(element)) {
                match = true;
            }
        }
        if (!match) {
            Util.report("The requested version " + requested + " by your slf4j binding is not compatible with "
                    + Arrays.asList(API_COMPATIBILITY_LIST).toString());
            Util.report("See " + VERSION_MISMATCH + " for further details.");
        }
    } catch (java.lang.NoSuchFieldError nsfe) {
        // given our large user base and SLF4J's commitment to backward
        // compatibility, we cannot cry here. Only for implementations
        // which willingly declare a REQUESTED_API_VERSION field do we
        // emit compatibility warnings.
    } catch (Throwable e) {
        // we should never reach here
        Util.report("Unexpected problem occured during version sanity check", e);
    }
}
 
开发者ID:bgandon,项目名称:juli-to-slf4j,代码行数:26,代码来源:LoggerFactory.java


注:本文中的org.slf4j.helpers.Util.report方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。