org.jboss.logging.Logger.infof()方法的使用及代码示例

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

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

Logger.infof介绍

[英]Issue a formatted log message with a level of INFO.
[中]发出带有信息级别的格式化日志消息。

代码示例

代码示例来源:origin: wildfly/wildfly

@Override
public void info(String msg, Object... args) {
  this.logger.infof(msg, args);
}

代码示例来源:origin: hibernate/hibernate-orm

@Override
public void end() {
  log.infof(
      "Session Metrics {\n" +
          "    %s nanoseconds spent acquiring %s JDBC connections;\n" +

代码示例来源:origin: hibernate/hibernate-orm

@Override
  public void evaluate() throws Throwable {
    final ClassLoader originalTCCL = Thread.currentThread().getContextClassLoader();
    final ClassLoader isolatedClassLoader = provider.buildIsolatedClassLoader();
    log.infof( "Overriding TCCL [%s] -> [%s]", originalTCCL, isolatedClassLoader );
    Thread.currentThread().setContextClassLoader( isolatedClassLoader );
    try {
      base.evaluate();
    }
    finally {
      assert Thread.currentThread().getContextClassLoader() == isolatedClassLoader;
      log.infof( "Reverting TCCL [%s] -> [%s]", isolatedClassLoader, originalTCCL );
      Thread.currentThread().setContextClassLoader( originalTCCL );
      provider.releaseIsolatedClassLoader( isolatedClassLoader );
    }
  }
};

代码示例来源:origin: hibernate/hibernate-orm

@Override
public void configure(Map configurationValues) {
  if ( configurationValues.containsKey( LEGACY_AUTO_REGISTER ) ) {
    log.debugf(
        "Encountered deprecated Envers setting [%s]; use [%s] or [%s] instead",
        LEGACY_AUTO_REGISTER,
        INTEGRATION_ENABLED,
        EnversIntegrator.AUTO_REGISTER
    );
  }
  this.integrationEnabled = ConfigurationHelper.getBoolean( INTEGRATION_ENABLED, configurationValues, true );
  log.infof( "Envers integration enabled? : %s", integrationEnabled );
}

代码示例来源:origin: hibernate/hibernate-orm

@Test
public void testWithComma() {
  doInJPA( this::entityManagerFactory, entityManager -> {
    Date now = entityManager.createQuery(
        "select FUNCTION('now',) " +
            "from Event " +
            "where id = :id", Date.class)
        .setParameter( "id", 1L )
        .getSingleResult();
    log.infof( "Current time: {}", now );
  } );
}

代码示例来源:origin: hibernate/hibernate-orm

@Test
public void testWithoutComma() {
  doInJPA( this::entityManagerFactory, entityManager -> {
    Date now = entityManager.createQuery(
      "select FUNCTION('now') " +
      "from Event " +
      "where id = :id", Date.class)
    .setParameter( "id", 1L )
    .getSingleResult();
    log.infof( "Current time: {}", now );
  } );
}

代码示例来源:origin: hibernate/hibernate-orm

private void processPerson(Person Person) {
  if ( Person.getId() % 1000 == 0 ) {
    log.infof( "Processing [%s]", Person.getName());
  }
}

代码示例来源:origin: hibernate/hibernate-orm

@Test
public void testAllAuthors() {
  doInJPA( this::entityManagerFactory, entityManager -> {
    List<Person> authors = entityManager.createQuery(
      "select p " +
      "from Person p " +
      "left join fetch p.books", Person.class)
    .getResultList();
    authors.forEach( author -> {
      log.infof( "Author %s wrote %d books",
        author.getFirstName() + " " + author.getLastName(),
        author.getBooks().size()
      );
    } );
  });
}

代码示例来源:origin: hibernate/hibernate-orm

@Test
public void testDistinctAuthors() {
  doInJPA( this::entityManagerFactory, entityManager -> {
    //tag::hql-distinct-entity-query-example[]
    List<Person> authors = entityManager.createQuery(
      "select distinct p " +
      "from Person p " +
      "left join fetch p.books", Person.class)
    .getResultList();
    //end::hql-distinct-entity-query-example[]
    authors.forEach( author -> {
      log.infof( "Author %s wrote %d books",
        author.getFirstName() + " " + author.getLastName(),
        author.getBooks().size()
      );
    } );
  });
}

代码示例来源:origin: hibernate/hibernate-orm

@Test
public void testDistinctAuthorsWithoutPassThrough() {
  doInJPA( this::entityManagerFactory, entityManager -> {
    //tag::hql-distinct-entity-query-hint-example[]
    List<Person> authors = entityManager.createQuery(
      "select distinct p " +
      "from Person p " +
      "left join fetch p.books", Person.class)
    .setHint( QueryHints.HINT_PASS_DISTINCT_THROUGH, false )
    .getResultList();
    //end::hql-distinct-entity-query-hint-example[]
    authors.forEach( author -> {
      log.infof( "Author %s wrote %d books",
        author.getFirstName() + " " + author.getLastName(),
        author.getBooks().size()
      );
    } );
  });
}

代码示例来源:origin: hibernate/hibernate-orm

.getResultList();
log.infof( "Fetched %d Departments", departments.size());

代码示例来源:origin: hibernate/hibernate-orm

@Test
public void test() {
  doInJPA( this::entityManagerFactory, entityManager -> {
    for ( long i = 0; i < 2; i++ ) {
      Department department = new Department();
      department.id = i + 1;
      entityManager.persist( department );
      for ( long j = 0; j < 3; j++ ) {
        Employee employee1 = new Employee();
        employee1.username = String.format( "user %d_%d", i, j );
        employee1.department = department;
        entityManager.persist( employee1 );
      }
    }
  } );
  doInJPA( this::entityManagerFactory, entityManager -> {
    //tag::fetching-strategies-fetch-mode-select-example[]
    List<Department> departments = entityManager.createQuery(
      "select d from Department d", Department.class )
    .getResultList();
    log.infof( "Fetched %d Departments", departments.size());
    for (Department department : departments ) {
      assertEquals( 3, department.getEmployees().size() );
    }
    //end::fetching-strategies-fetch-mode-select-example[]
  } );
}

代码示例来源:origin: hibernate/hibernate-orm

log.infof(
  "Department %d has {} employees",
  department.getId(),

代码示例来源:origin: hibernate/hibernate-orm

@Test
public void test() {
  doInJPA( this::entityManagerFactory, entityManager -> {
    for ( long i = 0; i < 2; i++ ) {
      Department department = new Department();
      department.id = i + 1;
      entityManager.persist( department );
      for ( long j = 0; j < 3; j++ ) {
        Employee employee1 = new Employee();
        employee1.username = String.format( "user %d_%d", i, j );
        employee1.department = department;
        entityManager.persist( employee1 );
      }
    }
  } );
  doInJPA( this::entityManagerFactory, entityManager -> {
    //tag::fetching-strategies-fetch-mode-join-example[]
    Department department = entityManager.find( Department.class, 1L );
    log.infof( "Fetched department: %s", department.getId());
    assertEquals( 3, department.getEmployees().size() );
    //end::fetching-strategies-fetch-mode-join-example[]
  } );
}

代码示例来源:origin: hibernate/hibernate-orm

log.infof(
    "Ignoring expected failure [%s] : %s",
    Helper.extractTestName( extendedFrameworkMethod ),

代码示例来源:origin: hibernate/hibernate-orm

@Test
public void test() {
  doInJPA( this::entityManagerFactory, entityManager -> {
    //tag::fetching-LazyCollection-persist-example[]
    Department department = new Department();
    department.setId( 1L );
    entityManager.persist( department );
    for (long i = 1; i <= 3; i++ ) {
      Employee employee = new Employee();
      employee.setId( i );
      employee.setUsername( String.format( "user_%d", i ) );
      department.addEmployee(employee);
    }
    //end::fetching-LazyCollection-persist-example[]
  } );
  doInJPA( this::entityManagerFactory, entityManager -> {
    //tag::fetching-LazyCollection-select-example[]
    Department department = entityManager.find(Department.class, 1L);
    int employeeCount = department.getEmployees().size();
    for(int i = 0; i < employeeCount; i++ ) {
      log.infof( "Fetched employee: %s", department.getEmployees().get( i ).getUsername());
    }
    //end::fetching-LazyCollection-select-example[]
  } );
}

代码示例来源:origin: hibernate/hibernate-orm

.getSingleResult();
log.infof(
  "The created_on timestamp value is: [%s]",
  personCreationTimestamp
);
log.infof(
  "For the current time zone: [%s], the UTC time zone offset is: [%d]",
  TimeZone.getDefault().getDisplayName(), timeZoneOffsetMillis

代码示例来源:origin: hibernate/hibernate-orm

log.infof( "Activate filter [%s]", "activeAccount");

代码示例来源:origin: hibernate/hibernate-orm

log.infof( "Activate filter [%s]", "activeAccount");
log.infof( "Activate filter [%s]", "activeAccount");
log.infof( "Activate filter [%s]", "activeAccount");
log.infof( "Activate filter [%s]", "activeAccount");
log.infof( "Activate filter [%s]", "activeAccount");

代码示例来源:origin: hibernate/hibernate-orm

log.infof( "Activate filter [%s]", "firstAccounts");

相关文章