org.modeshape.common.logging.Logger.getLogger()方法的使用及代码示例

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

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

Logger.getLogger介绍

[英]Return a logger named corresponding to the class passed as parameter.
[中]返回与作为参数传递的类相对应的名为的记录器。

代码示例

代码示例来源:origin: org.fcrepo/modeshape-jcr

/**
 * Return a logger associated with this context. This logger records only those activities within the context and provide a
 * way to capture the context-specific activities. All log messages are also sent to the system logger, so classes that log
 * via this mechanism should <i>not</i> also {@link Logger#getLogger(Class) obtain a system logger}.
 * 
 * @param name the name for the logger
 * @return the logger, named after <code>clazz</code>; never null
 * @see #getLogger(Class)
 */
public Logger getLogger( String name ) {
  return Logger.getLogger(name);
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

/**
 * Return a logger associated with this context. This logger records only those activities within the context and provide a
 * way to capture the context-specific activities. All log messages are also sent to the system logger, so classes that log
 * via this mechanism should <i>not</i> also {@link Logger#getLogger(Class) obtain a system logger}.
 * 
 * @param clazz the class that is doing the logging
 * @return the logger, named after <code>clazz</code>; never null
 * @see #getLogger(String)
 */
public Logger getLogger( Class<?> clazz ) {
  return Logger.getLogger(clazz);
}

代码示例来源:origin: ModeShape/modeshape

/**
 * Return a logger associated with this context. This logger records only those activities within the context and provide a
 * way to capture the context-specific activities. All log messages are also sent to the system logger, so classes that log
 * via this mechanism should <i>not</i> also {@link Logger#getLogger(Class) obtain a system logger}.
 * 
 * @param clazz the class that is doing the logging
 * @return the logger, named after <code>clazz</code>; never null
 * @see #getLogger(String)
 */
public Logger getLogger( Class<?> clazz ) {
  return Logger.getLogger(clazz);
}

代码示例来源:origin: ModeShape/modeshape

/**
 * Return a logger associated with this context. This logger records only those activities within the context and provide a
 * way to capture the context-specific activities. All log messages are also sent to the system logger, so classes that log
 * via this mechanism should <i>not</i> also {@link Logger#getLogger(Class) obtain a system logger}.
 * 
 * @param name the name for the logger
 * @return the logger, named after <code>clazz</code>; never null
 * @see #getLogger(Class)
 */
public Logger getLogger( String name ) {
  return Logger.getLogger(name);
}

代码示例来源:origin: org.fcrepo/modeshape-common

/**
 * Return a logger named corresponding to the class passed as parameter.
 * 
 * @param clazz the returned logger will be named after clazz
 * @return logger
 */
Logger getLogger( Class<?> clazz ) {
  return Logger.getLogger(clazz.getName());
}

代码示例来源:origin: org.modeshape/modeshape-common

/**
 * Return a logger named corresponding to the class passed as parameter.
 * 
 * @param clazz the returned logger will be named after clazz
 * @return logger
 */
Logger getLogger( Class<?> clazz ) {
  return Logger.getLogger(clazz.getName());
}

代码示例来源:origin: ModeShape/modeshape

/**
 * Return a logger named corresponding to the class passed as parameter.
 * 
 * @param clazz the returned logger will be named after clazz
 * @return logger
 */
Logger getLogger( Class<?> clazz ) {
  return Logger.getLogger(clazz.getName());
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

protected IndexChangeAdapter( ExecutionContext context,
               String workspaceName,
               NodeTypePredicate predicate,
               ProvidedIndex<?> index ) {
  super(context, predicate);
  assert index != null;
  this.index = index;
  assert workspaceName != null;
  this.workspaceName = workspaceName;
  this.logger = Logger.getLogger(getClass());
}

代码示例来源:origin: ModeShape/modeshape

protected IndexChangeAdapter( ExecutionContext context,
               String workspaceName,
               NodeTypePredicate predicate,
               ProvidedIndex<?> index ) {
  super(context, predicate);
  assert index != null;
  this.index = index;
  assert workspaceName != null;
  this.workspaceName = workspaceName;
  this.logger = Logger.getLogger(getClass());
}

代码示例来源:origin: ModeShape/modeshape

/**
 * Creates a new logger instance for the underlying class.
 *
 * @param clazz a {@link Class} instance; never null
 * @return a {@link org.modeshape.jcr.api.Logger} implementation
 */
public static org.modeshape.jcr.api.Logger getLogger(Class<?> clazz) {
  return new ExtensionLogger(Logger.getLogger(clazz));
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

/**
 * Creates a new logger instance for the underlying class.
 *
 * @param clazz a {@link Class} instance; never null
 * @return a {@link org.modeshape.jcr.api.Logger} implementation
 */
public static org.modeshape.jcr.api.Logger getLogger(Class<?> clazz) {
  return new ExtensionLogger(Logger.getLogger(clazz));
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

protected TikaMimeTypeDetector( Environment environment ) {
  assert environment != null;
  this.logger = Logger.getLogger(getClass());
  // the extra classpath entry is the package name of the tika extractor, so it can be located inside AS7 (see
  // RepositoryService)
  ClassLoader loader = environment.getClassLoader(this, "org.modeshape.extractor.tika");
  logger.debug("Initializing mime-type detector...");
  initDetector(loader);
  logger.debug("Successfully initialized detector: {0}", getClass().getName());
}

代码示例来源:origin: ModeShape/modeshape

protected TikaMimeTypeDetector( Environment environment ) {
  assert environment != null;
  this.logger = Logger.getLogger(getClass());
  // the extra classpath entry is the package name of the tika extractor, so it can be located inside AS7 (see
  // RepositoryService)
  ClassLoader loader = environment.getClassLoader(this, "org.modeshape.extractor.tika");
  logger.debug("Initializing mime-type detector...");
  initDetector(loader);
  logger.debug("Successfully initialized detector: {0}", getClass().getName());
}

代码示例来源:origin: ModeShape/modeshape

protected AbstractSessionCache(ExecutionContext context,
                WorkspaceCache sharedWorkspaceCache) {
  this.logger = Logger.getLogger(getClass());
  this.context = context;
  this.sharedWorkspaceCache = sharedWorkspaceCache;
  this.workspaceCache.set(sharedWorkspaceCache);
  ValueFactories factories = this.context.getValueFactories();
  this.nameFactory = factories.getNameFactory();
  this.pathFactory = factories.getPathFactory();
  this.rootPath = this.pathFactory.createRootPath();
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

protected Connectors( JcrRepository.RunningState repository,
           RepositoryConfiguration.Federation config, 
           Problems problems) {
  this.repository = repository;
  this.logger = Logger.getLogger(getClass());
  List<Component> components = config.getConnectors(problems);
  Map<String, List<RepositoryConfiguration.ProjectionConfiguration>> preconfiguredProjections = config.getProjectionsByWorkspace();
  Set<String> externalSources = config.getExternalSources();
  this.snapshot.set(new Snapshot(components, externalSources, preconfiguredProjections));
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

protected AbstractSessionCache(ExecutionContext context,
                WorkspaceCache sharedWorkspaceCache) {
  this.logger = Logger.getLogger(getClass());
  this.context = context;
  this.sharedWorkspaceCache = sharedWorkspaceCache;
  this.workspaceCache.set(sharedWorkspaceCache);
  ValueFactories factories = this.context.getValueFactories();
  this.nameFactory = factories.getNameFactory();
  this.pathFactory = factories.getPathFactory();
  this.rootPath = this.pathFactory.createRootPath();
}

代码示例来源:origin: ModeShape/modeshape

protected Connectors( JcrRepository.RunningState repository,
           RepositoryConfiguration.Federation config, 
           Problems problems) {
  this.repository = repository;
  this.logger = Logger.getLogger(getClass());
  List<Component> components = config.getConnectors(problems);
  Map<String, List<RepositoryConfiguration.ProjectionConfiguration>> preconfiguredProjections = config.getProjectionsByWorkspace();
  Set<String> externalSources = config.getExternalSources();
  this.snapshot.set(new Snapshot(components, externalSources, preconfiguredProjections));
}

代码示例来源:origin: ModeShape/modeshape

private void cleanLocks() {
  try {
    lockManager().cleanLocks();
  } catch (RepositoryException e) {
    // This can only happen if the session is not live, which is checked above ...
    Logger.getLogger(getClass()).error(e, JcrI18n.unexpectedException, e.getMessage());
  }
}

代码示例来源:origin: org.fcrepo/modeshape-jcr

private void cleanLocks() {
  try {
    lockManager().cleanLocks();
  } catch (RepositoryException e) {
    // This can only happen if the session is not live, which is checked above ...
    Logger.getLogger(getClass()).error(e, JcrI18n.unexpectedException, e.getMessage());
  }
}

代码示例来源:origin: ModeShape/modeshape

@Before
public void beforeEach() {
  logger = Logger.getLogger(getClass());
  // default to an in-memory h2
  schematicDb = Schematic.getDb(new TestingEnvironment().defaultPersistenceConfiguration());
  schematicDb.start();
  TransactionManagerLookup txManagerLookup = new DefaultTransactionManagerLookup();
  TransactionManager txManager = txManagerLookup.getTransactionManager();
  assertNotNull("Was not able to locate a transaction manager in the test classpath", txManager);
  repoEnv = new TestRepositoryEnvironment(txManager, schematicDb);
}

相关文章