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

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

本文整理了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

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

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

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

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

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

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

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

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

  1. /**
  2. * Return a logger named corresponding to the class passed as parameter.
  3. *
  4. * @param clazz the returned logger will be named after clazz
  5. * @return logger
  6. */
  7. Logger getLogger( Class<?> clazz ) {
  8. return Logger.getLogger(clazz.getName());
  9. }

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

  1. /**
  2. * Return a logger named corresponding to the class passed as parameter.
  3. *
  4. * @param clazz the returned logger will be named after clazz
  5. * @return logger
  6. */
  7. Logger getLogger( Class<?> clazz ) {
  8. return Logger.getLogger(clazz.getName());
  9. }

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

  1. /**
  2. * Return a logger named corresponding to the class passed as parameter.
  3. *
  4. * @param clazz the returned logger will be named after clazz
  5. * @return logger
  6. */
  7. Logger getLogger( Class<?> clazz ) {
  8. return Logger.getLogger(clazz.getName());
  9. }

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

  1. protected IndexChangeAdapter( ExecutionContext context,
  2. String workspaceName,
  3. NodeTypePredicate predicate,
  4. ProvidedIndex<?> index ) {
  5. super(context, predicate);
  6. assert index != null;
  7. this.index = index;
  8. assert workspaceName != null;
  9. this.workspaceName = workspaceName;
  10. this.logger = Logger.getLogger(getClass());
  11. }

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

  1. protected IndexChangeAdapter( ExecutionContext context,
  2. String workspaceName,
  3. NodeTypePredicate predicate,
  4. ProvidedIndex<?> index ) {
  5. super(context, predicate);
  6. assert index != null;
  7. this.index = index;
  8. assert workspaceName != null;
  9. this.workspaceName = workspaceName;
  10. this.logger = Logger.getLogger(getClass());
  11. }

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

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

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

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

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

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

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

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

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

  1. protected AbstractSessionCache(ExecutionContext context,
  2. WorkspaceCache sharedWorkspaceCache) {
  3. this.logger = Logger.getLogger(getClass());
  4. this.context = context;
  5. this.sharedWorkspaceCache = sharedWorkspaceCache;
  6. this.workspaceCache.set(sharedWorkspaceCache);
  7. ValueFactories factories = this.context.getValueFactories();
  8. this.nameFactory = factories.getNameFactory();
  9. this.pathFactory = factories.getPathFactory();
  10. this.rootPath = this.pathFactory.createRootPath();
  11. }

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

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

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

  1. protected AbstractSessionCache(ExecutionContext context,
  2. WorkspaceCache sharedWorkspaceCache) {
  3. this.logger = Logger.getLogger(getClass());
  4. this.context = context;
  5. this.sharedWorkspaceCache = sharedWorkspaceCache;
  6. this.workspaceCache.set(sharedWorkspaceCache);
  7. ValueFactories factories = this.context.getValueFactories();
  8. this.nameFactory = factories.getNameFactory();
  9. this.pathFactory = factories.getPathFactory();
  10. this.rootPath = this.pathFactory.createRootPath();
  11. }

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

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

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

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

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

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

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

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

相关文章