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


Java Logger类代码示例

本文整理汇总了Java中net.java.sip.communicator.util.Logger的典型用法代码示例。如果您正苦于以下问题:Java Logger类的具体用法?Java Logger怎么用?Java Logger使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Logger类属于net.java.sip.communicator.util包,在下文中一共展示了Logger类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: start

import net.java.sip.communicator.util.Logger; //导入依赖的package包/类
/**
 * Calls <tt>Thread.setUncaughtExceptionHandler()</tt>
 *
 * @param context The execution context of the bundle being started
 * (unused).
 * @throws Exception If this method throws an exception, this bundle is
 *   marked as stopped and the Framework will remove this bundle's
 *   listeners, unregister all services registered by this bundle, and
 *   release all services used by this bundle.
 */
public void start(BundleContext context)
    throws Exception
{
    logger.info("DNS service ... [STARTING]");
    bundleContext = context;
    context.addServiceListener(this);

    if(Logger.getLogger("org.xbill").isTraceEnabled())
        Options.set("verbose", "1");

    Lookup.setPacketLogger(new DnsJavaLogger());

    if(loadDNSProxyForward())
    {
        // dns is forced to go through a proxy so skip any further settings
        return;
    }

    if(UtilActivator.getConfigurationService().getBoolean(
            DnsUtilActivator.PNAME_BACKUP_RESOLVER_ENABLED,
            DnsUtilActivator.PDEFAULT_BACKUP_RESOLVER_ENABLED)
        && !getConfigurationService().getBoolean(
            CustomResolver.PNAME_DNSSEC_RESOLVER_ENABLED,
            CustomResolver.PDEFAULT_DNSSEC_RESOLVER_ENABLED))
    {
        bundleContext.registerService(
            CustomResolver.class.getName(),
            new ParallelResolverImpl(),
            null);
        logger.info("ParallelResolver ... [REGISTERED]");
    }

    if(getConfigurationService().getBoolean(
        CustomResolver.PNAME_DNSSEC_RESOLVER_ENABLED,
        CustomResolver.PDEFAULT_DNSSEC_RESOLVER_ENABLED))
    {
        bundleContext.registerService(
            CustomResolver.class.getName(),
            new ConfigurableDnssecResolver(new ExtendedResolver()),
            null);
        logger.info("DnssecResolver ... [REGISTERED]");
    }

    logger.info("DNS service ... [STARTED]");
}
 
开发者ID:jitsi,项目名称:jitsi,代码行数:56,代码来源:DnsUtilActivator.java

示例2: throwOperationFailedException

import net.java.sip.communicator.util.Logger; //导入依赖的package包/类
/**
 * Logs a specific message and associated <tt>Throwable</tt> cause as an
 * error using the current <tt>Logger</tt> and then throws a new
 * <tt>OperationFailedException</tt> with the message, a specific error code
 * and the cause.
 *
 * @param message the message to be logged and then wrapped in a new
 * <tt>OperationFailedException</tt>
 * @param errorCode the error code to be assigned to the new
 * <tt>OperationFailedException</tt>
 * @param cause the <tt>Throwable</tt> that has caused the necessity to log
 * an error and have a new <tt>OperationFailedException</tt> thrown
 * @param logger the logger that we'd like to log the error <tt>message</tt>
 * and <tt>cause</tt>.
 *
 * @throws OperationFailedException the exception that we wanted this method
 * to throw.
 */
public static void throwOperationFailedException( String    message,
                                                  int       errorCode,
                                                  Throwable cause,
                                                  Logger    logger)
    throws OperationFailedException
{
    logger.error(message, cause);

    if(cause == null)
        throw new OperationFailedException(message, errorCode);
    else
        throw new OperationFailedException(message, errorCode, cause);
}
 
开发者ID:zhaozw,项目名称:android-1,代码行数:32,代码来源:ProtocolProviderServiceSipImpl.java


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