org.xwiki.component.logging.Logger.warn()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(8.6k)|赞(0)|评价(0)|浏览(81)

本文整理了Java中org.xwiki.component.logging.Logger.warn()方法的一些代码示例,展示了Logger.warn()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.warn()方法的具体详情如下:
包路径:org.xwiki.component.logging.Logger
类名称:Logger
方法名:warn

Logger.warn介绍

暂无

代码示例

代码示例来源:origin: org.xwiki.platform/xwiki-core-extension-api

/**
 * {@inheritDoc}
 * 
 * @see org.codehaus.plexus.logging.Logger#warn(java.lang.String, java.lang.Throwable)
 */
public void warn(String message, Throwable throwable)
{
  this.logger.warn(message, throwable);
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-extension-api

/**
 * {@inheritDoc}
 * 
 * @see org.codehaus.plexus.logging.Logger#warn(java.lang.String)
 */
public void warn(String message)
{
  this.logger.warn(message);
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-extension-api

public List<ExtensionRepositoryId> getRepositories()
{
  List<ExtensionRepositoryId> repositories = new ArrayList<ExtensionRepositoryId>();
  List<String> repositoryStrings =
    this.configurationSource.getProperty("extension.repositories", Collections.<String> emptyList());
  if (repositoryStrings != null && !repositoryStrings.isEmpty()) {
    for (String repositoryString : repositoryStrings) {
      try {
        ExtensionRepositoryId extensionRepositoryId = parseRepository(repositoryString);
        repositories.add(extensionRepositoryId);
      } catch (Exception e) {
        getLogger().warn("Faild to parse repository [" + repositoryString + "] from configuration", e);
      }
    }
  } else {
    try {
      repositories.add(new ExtensionRepositoryId("xwiki-releases", "maven", new URI(
        "http://maven.xwiki.org/releases/")));
      repositories.add(new ExtensionRepositoryId("central", "maven",
        new URI("http://repo1.maven.org/maven2/")));
    } catch (Exception e) {
      // Should never happen
    }
  }
  return repositories;
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-xml

source = new InputSource(istream);
  } else {
    getLogger().warn(String.format("Failed to load resource [%s] locally. "
      + "Will try to get it online at [%s]", filename, systemId));
    source = new InputSource(istream);
  } else {
    getLogger().warn("Failed to load resource [" + systemId + "] locally.");
getLogger().warn(String.format("Invalid URI [%s]", systemId), e);

代码示例来源:origin: org.xwiki.platform/xwiki-core-extension-api

getLogger().warn("Failed to load extension from file [" + child + "] in local repository", e);

代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core

/**
 * @param remoteData the serialized version of the context
 * @return the XWiki context
 */
protected XWikiContext unserializeXWikiContext(Serializable remoteData)
{
  XWikiContext xcontext = getXWikiStubContext();
  Map<String, Serializable> remoteDataMap = (Map<String, Serializable>) remoteData;
  if (xcontext != null) {
    xcontext.setDatabase((String) remoteDataMap.get(CONTEXT_WIKI));
    xcontext.setUser((String) remoteDataMap.get(CONTEXT_USER));
  } else {
    getLogger().warn(
      "Can't get a proper XWikiContext."
        + " It generally mean that the wiki has never been fully initialized,"
        + " i.e. has never been accesses at least once");
  }
  return xcontext;
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-observation-local

getLogger().warn(
  "The [" + eventListener.getClass().getName() + "] listener has overwritten a previously "
    + "registered listener [" + previousListener.getClass().getName()

代码示例来源:origin: org.xwiki.platform/xwiki-core-rendering-transformation-macro

getLogger().warn("Invalid Macro descriptor format for hint [" + entry.getKey()
  + "]. The hint should contain either the macro name only or the macro name followed by "
  + "the syntax for which it is valid. In that case the macro name should be followed by a "

代码示例来源:origin: org.xwiki.platform/xwiki-core-officeimporter

/**
 * Utility method for building a {@link OfficeImporterFilter} suitable for this import operation. If no external
 * filter has been specified a {@link DefaultOfficeImporterFilter} will be used.
 * 
 * @param params additional parameters provided for this import operation.
 * @return an {@link OfficeImporterFilter}.
 */
private OfficeImporterFilter getImporterFilter(Map<String, String> params)
{
  OfficeImporterFilter importerFilter = null;
  String groovyFilterParam = params.get("groovyFilter");
  if (null != groovyFilterParam && !groovyFilterParam.equals("")) {
    try {
      String groovyScript = docBridge.getDocumentContent(groovyFilterParam);
      GroovyClassLoader gcl = new GroovyClassLoader();
      importerFilter = (OfficeImporterFilter) gcl.parseClass(groovyScript).newInstance();
    } catch (Throwable t) {
      getLogger().warn("Could not build the groovy filter.", t);
    }
  }
  importerFilter = (importerFilter == null) ? new DefaultOfficeImporterFilter() : importerFilter;
  importerFilter.setDocBridge(docBridge);
  return importerFilter;
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-observation-remote

/**
 * Load channel configuration.
 * 
 * @param channelId the identifier of the channel
 * @return the channel configuration
 * @throws IOException failed to load configuration file
 * @throws ChannelException failed to creation channel configuration
 */
private ProtocolStackConfigurator loadChannelConfiguration(String channelId) throws IOException, ChannelException
{
  ProtocolStackConfigurator configurator = null;
  String path = "/WEB-INF/" + CONFIGURATION_PATH + channelId + ".xml";
  InputStream is = this.container.getApplicationContext().getResourceAsStream(path);
  if (is != null) {
    configurator = XmlConfigurator.getInstance(is);
  } else {
    getLogger().warn(
      "Can't find a configuration for channel [" + channelId + "] at [" + path + "]. Using "
        + JChannel.DEFAULT_PROTOCOL_STACK + " JGRoups default configuration.");
    configurator = ConfiguratorFactory.getStackConfigurator(JChannel.DEFAULT_PROTOCOL_STACK);
  }
  return configurator;
}

代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core

/**
   * @see CoreConfiguration#getDefaultDocumentSyntax()
   * @since 2.3M1
   */
  public Syntax getDefaultDocumentSyntax()
  {
    // If the found value is an empty string then default to the configuration value in the main configuration
    // source.
    // TODO: In the future we would need the notion of initialized/not-initialized property values in the wiki.
    // When this is implemented modify the code below.
    String key = PREFIX + "defaultDocumentSyntax";
    String syntaxId = this.configuration.getProperty(key, String.class);
    
    if (StringUtils.isEmpty(syntaxId)) {
      syntaxId = this.xwikiPropertiesConfiguration.getProperty(key, Syntax.XWIKI_2_0.toIdString());
    }

    // Try to parse the syntax and if it fails defaults to the XWiki Syntax 2.0
    Syntax syntax;
    try {
      syntax = this.syntaxFactory.createSyntaxFromIdString(syntaxId);
    } catch (ParseException e) {
      getLogger().warn("Invalid default document Syntax [" + syntaxId + "], defaulting to ["
        + Syntax.XWIKI_2_0.toIdString() + "] instead", e);
      syntax = Syntax.XWIKI_2_0;
    }

    return syntax; 
  }
}

代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core

/**
   * {@inheritDoc}
   * 
   * @see org.xwiki.observation.EventListener#onEvent(org.xwiki.observation.event.Event, java.lang.Object,
   *      java.lang.Object)
   */
  @SuppressWarnings("unchecked")
  public void onEvent(Event event, Object source, Object data)
  {
    // when import is done, re-register macros in the current wiki
    try {
      // clean the grouplist cache from the context since now, after import, the groups have changed. All
      // cache saved on the context during the import (save listeners) should be cleaned since it might not be
      // accurate.
      // FIXME: somehow, it's a bit of time loss to clean the context grouplist, especially when this is done
      // for a subsequent import (not the initial import of the .xar), when macros are registered anyway, there
      // are no rights issues on registering macros on documents save.
      XWikiContext xcontext = (XWikiContext) execution.getContext().getProperty("xwikicontext");
      xcontext.remove("grouplist");
      // get the current wiki to register macros for
      String currentWiki = xcontext.getDatabase();
      macroInitializer.registerExistingWikiMacros(currentWiki);
    } catch (Exception e) {
      getLogger().warn("Could not register existing macros on import", e);
    }
  }
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-velocity

/**
 * {@inheritDoc}
 * 
 * @see LogChute#log(int, String)
 */
public void log(int level, String message)
{
  switch (level) {
    case LogChute.WARN_ID:
      getLogger().warn(message);
      break;
    case LogChute.INFO_ID:
      // Velocity info messages are too verbose, just consider them as debug messages...
      getLogger().debug(message);
      break;
    case LogChute.DEBUG_ID:
      getLogger().debug(message);
      break;
    case LogChute.ERROR_ID:
      getLogger().error(message);
      break;
    default:
      getLogger().debug(message);
      break;
  }
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-velocity

/**
 * {@inheritDoc}
 * 
 * @see LogChute#log(int, String, Throwable)
 */
public void log(int level, String message, Throwable throwable)
{
  switch (level) {
    case LogChute.WARN_ID:
      getLogger().warn(message, throwable);
      break;
    case LogChute.INFO_ID:
      // Velocity info messages are too verbose, just consider them as debug messages...
      getLogger().debug(message, throwable);
      break;
    case LogChute.DEBUG_ID:
      getLogger().debug(message, throwable);
      break;
    case LogChute.ERROR_ID:
      getLogger().error(message, throwable);
      break;
    default:
      getLogger().debug(message, throwable);
      break;
  }
}

相关文章

微信公众号

最新文章

更多