• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Logger类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MarqueeToolEntry类代码示例发布时间:2022-05-23
下一篇:
Java HostAuthenticationToken类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap